Forum Moderators: coopster

Message Too Old, No Replies

Unix Timestamp into Textual Date Time

Unix Timestamp into Textual Date Time

         

kkonline

8:35 am on Aug 14, 2007 (gmt 0)

10+ Year Member




How do i convert a Unix timestamp into English textual date time description? In my database i have stored the date and time as 1187079740 and now i want it to be converted into 14/08/2007 13:52:20. I have currently used


<?php
$format = '%d/%m/%Y %H:%M:%S';
$strf = strftime($format);
echo "$strf\n";
print_r(strptime($strf, $format));
?>

I am generating data from a db to xml which gives date as

 <date>1187079740</date> 

Now my task is to convert SPECIFICALLY the value 1187079740 into it's actual textual form of 14/08/2007 13:52:20.

I want the data 1187079740 to be written into a php script to generate it's textual time.

Habtom

8:44 am on Aug 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$date_f = date("m/j/Y, g:i a", $date_timestamp);

You can get the details PHP:Date - Manual [php.net]

Habtom

kkonline

3:38 pm on Aug 14, 2007 (gmt 0)

10+ Year Member



thanks a lot for ur help... it worked