fife Posted May 30, 2011 Share Posted May 30, 2011 can someone please tell me how to echo the current time or date? I have the date in the format 1306768978 in the database but I dont want to echo it back that way obviously. Not only that but does anybody know of a good tutorial on how to use this function? Link to comment https://forums.phpfreaks.com/topic/237883-strtotime-function-help/ Share on other sites More sharing options...
kenrbnsn Posted May 30, 2011 Share Posted May 30, 2011 You don't need strtotime when the date/time is in that format, which is the number of seconds since 1970-01-01, just use the date function: <?php $date = 1306768978; echo date('Y-m-d',$date) . "<br>\n"; // yyyy-mm-dd echo date(l, F j, Y, $date) . "<br>\n"; // weekday, Month day, yyyy ?> Ken Link to comment https://forums.phpfreaks.com/topic/237883-strtotime-function-help/#findComment-1222394 Share on other sites More sharing options...
fife Posted May 30, 2011 Author Share Posted May 30, 2011 cool thanks again Ken Link to comment https://forums.phpfreaks.com/topic/237883-strtotime-function-help/#findComment-1222397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.