Mar 24, 2004 #1 buzzt Programmer Oct 17, 2002 171 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 May 6, 2002 15,350 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 Mar 3, 2004 326 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 May 6, 2002 15,350 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 Oct 17, 2002 171 CA The last one did it perfectly! Thanks lots! Upvote 0 Downvote