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 Quote 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 Quote 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! Quote 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. Quote 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; Quote 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!! Quote Link to comment https://forums.phpfreaks.com/topic/99548-timestamp-help/#findComment-509262 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.