Can someone please help me? I am trying to read a datetime field from a database, including the AM or PM designation. I keep getting PM, no matter what the time is.
A little background: I have a form that allows administrators to create and/or modify meeting schedules. The datetime field is pulled from the database of an existing record and displayed in six separate dropdown boxes for editing (Month, Day, Year, Hour, Min, AM/PM).
I have the date and time going in fine (combining the separate fields into the datetime format), but the AM/PM readback is always PM. I read that I need to use the following to get this field:
$sql = "SELECT blah, blah, date1 FROM table WHERE ID=$ID";
$selTime = $myrow[2];
$varAM =strftime("%p",$selTime); <----------
However, doing this I always get PM. On an example record, the database contains this datetime field information:
2003-05-28 08:15:00
Any suggestions will be greatly appreciated!
Geogal
🙂