alohatofu Posted April 4, 2008 Share Posted April 4, 2008 I would like to echo out the timestamp in this format 0000-00-00 00:00:00 could someone please help? echo strtotime("now"), "\n"; gives me this format 1207319717 Thanks Link to comment https://forums.phpfreaks.com/topic/99548-timestamp-help/ Share on other sites More sharing options...
craygo Posted April 4, 2008 Share Posted April 4, 2008 you have to use date() $date = date("Y-m-d G:i:s"); echo $date; Ray Link to comment https://forums.phpfreaks.com/topic/99548-timestamp-help/#findComment-509250 Share on other sites More sharing options...
alohatofu Posted April 4, 2008 Author Share Posted April 4, 2008 OK now I'm 5 hours behind.. how do I convert it? Thanks! Link to comment https://forums.phpfreaks.com/topic/99548-timestamp-help/#findComment-509252 Share on other sites More sharing options...
haku Posted April 4, 2008 Share Posted April 4, 2008 Add 5 hours worth of seconds. Link to comment https://forums.phpfreaks.com/topic/99548-timestamp-help/#findComment-509254 Share on other sites More sharing options...
craygo Posted April 4, 2008 Share Posted April 4, 2008 $date = date("Y-m-d G:i:s", strtotime("now - 5 hours")); echo $date; Link to comment https://forums.phpfreaks.com/topic/99548-timestamp-help/#findComment-509256 Share on other sites More sharing options...
alohatofu Posted April 4, 2008 Author Share Posted April 4, 2008 $date = date("Y-m-d G:i:s", strtotime("now + 5 hours")); thank you!! Link to comment https://forums.phpfreaks.com/topic/99548-timestamp-help/#findComment-509262 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.