Jump to content

Converting TIMESTAMP fields into "real time"?


DBookatay

Recommended Posts

You need to use a combination of the strtotime() function and the date() function:

<?php
$date1 = '2007-03-21 10:51:28';
$date2 = '2007-03-21 13:51:28';
echo 'date1: ' . date('g:i a',strtotime($date1)).'<br>';
echo 'date2: ' . date('g:i a',strtotime($date2));
?>

 

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.