Mar 24, 2004 #1 buzzt Programmer Joined Oct 17, 2002 Messages 171 Location CA Anyone have some nice compact code for converting military time (24:00) taken from a MySQL database to standard using PHP?
Anyone have some nice compact code for converting military time (24:00) taken from a MySQL database to standard using PHP?
Mar 24, 2004 #2 sleipnir214 Programmer Joined May 6, 2002 Messages 15,350 Location US If the hours are > 12, subtract 12? Want the best answers? Ask the best questions! TANSTAAFL!! Upvote 0 Downvote
Mar 24, 2004 #3 bastienk Programmer Joined Mar 3, 2004 Messages 326 Location CA use mysql's dateformat use php date("format options",$dbvalue); Bastien Cat, the other other white meat Upvote 0 Downvote
use mysql's dateformat use php date("format options",$dbvalue); Bastien Cat, the other other white meat
Mar 24, 2004 #4 sleipnir214 Programmer Joined May 6, 2002 Messages 15,350 Location US or better still, assuming $foo is a variable which contains the datetime value from MySQL: date ('some format string', strtotime($foo)) Want the best answers? Ask the best questions! TANSTAAFL!! Upvote 0 Downvote
or better still, assuming $foo is a variable which contains the datetime value from MySQL: date ('some format string', strtotime($foo)) Want the best answers? Ask the best questions! TANSTAAFL!!
Mar 24, 2004 Thread starter #5 buzzt Programmer Joined Oct 17, 2002 Messages 171 Location CA The last one did it perfectly! Thanks lots! Upvote 0 Downvote