kernelgpf Posted January 10, 2007 Share Posted January 10, 2007 Subject says it all.. I'm basically trying to set the time to the END of the current hour, with this code..$rundate=date('Y-m-d h:00:00', strtotime("+1 hour"));But the zeros disappear once the hour is added, and minutes and seconds take their place, I DON'T want this to happen. Any advice? Link to comment https://forums.phpfreaks.com/topic/33632-how-to-format-time-and-date-in-a-variable-not-the-current-timedate/ Share on other sites More sharing options...
emehrkay Posted January 10, 2007 Share Posted January 10, 2007 maybe this. i didnt try it$rundate=date('Y-m-d h:m:s', strtotime("+1 hour")); Link to comment https://forums.phpfreaks.com/topic/33632-how-to-format-time-and-date-in-a-variable-not-the-current-timedate/#findComment-157578 Share on other sites More sharing options...
kenrbnsn Posted January 10, 2007 Share Posted January 10, 2007 That's going to give the OP what he doesn't want. I tried the OP's code and it worked find for me.Ken Link to comment https://forums.phpfreaks.com/topic/33632-how-to-format-time-and-date-in-a-variable-not-the-current-timedate/#findComment-157580 Share on other sites More sharing options...
obsidian Posted January 10, 2007 Share Posted January 10, 2007 [quote author=kenrbnsn link=topic=121820.msg501560#msg501560 date=1168457376]That's going to give the OP what he doesn't want. I tried the OP's code and it worked find for me.Ken[/quote]Same here... if you're having an issue with it, though, just figure it to the hour and then add the zeros after:[code]<?php$rundate=date('Y-m-d h', strtotime("+1 hour")) . ':00:00';?>[/code] Link to comment https://forums.phpfreaks.com/topic/33632-how-to-format-time-and-date-in-a-variable-not-the-current-timedate/#findComment-157640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.