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? Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/237883-strtotime-function-help/#findComment-1222397 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.