I am trying to create a function for a pulldown box that displays the hours & half hours of a day in order from 11:30 PM descending. The catch is, I want to send the function a timezone offset, such as -5 (which is EST), and have the function automatically convert and sort the dates accordingly.
An example of what I would like is the following if I sent the timezone offset of -5:
<option value="23:00">11:00 PM</option>
<option value="22:30">10:30 PM</option>
<option value="22:00">10:00 PM</option>
I have been messing around with it, but I can't figure out how to get the dates to convert and then order themselves in the method that I specified.
Has anyone seen a script that does this, or have an idea on how to accomplish this?