Hey all - Happy Friday to those where it's currently Friday! =)
I was coming to the board baffled about a timezone issue that I can't see to resolve online. I see that blackhorse just submitted a similar issue but I can't tell that it's what I'm looking for, so I am posting my problem here.
I have an input box where someone selects their current timezone from a drop down and then writes in the time.
I then put the two together to form a string:
$submitted_time = $_GET["q0_Whattimeie323pm"] . " " . $_GET["q13_Whattimezoneareyouin"];
That $submitted_time should now say something like "16:42 CST"
I use strtotime() to convert it to a timestamp.
Now that I have the timestamp, I need to convert it back to a full date where I can pick what timezone to return it in.
$converted_time = strtotime($submitted_time);
$convert_to_readable = date("m/d/y g:i A", $converted_time);
I cannot figure out how to do this. I see "O" as an option in date() but don't see any examples of how to use it of offset time.
Right now it's giving me back "10/16/09 4:42 PM" but I want to choose the timezone I get it in.
Does anyone know how to do this with date() or another method?
Thanks!