Jump to content

do I need to insert am/pm in the database?


abs0lut

Recommended Posts

No, a datetime value has the time stored as a 24 hour clock.  You would used a combination of the date() and strtotime() functions:

 

<?php
$datestr = '2008-08-08 18:48:39'; // assume this was just pulled from the database
echo date('g:i A',strtotime($datestr));
?>

 

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.