corkg Posted September 30, 2007 Share Posted September 30, 2007 Hi I have a date formated, which has had seconds added $newtime = date('Y/m/d H:i:s', strtotime("+$sec seconds")); How do i generate the amount of seconds after the from the $newtime? Link to comment https://forums.phpfreaks.com/topic/71248-date/ Share on other sites More sharing options...
AndyB Posted September 30, 2007 Share Posted September 30, 2007 after the what? Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-358358 Share on other sites More sharing options...
corkg Posted September 30, 2007 Author Share Posted September 30, 2007 How do i generate the amount of seconds from the date then minus date now Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-358432 Share on other sites More sharing options...
Ninjakreborn Posted September 30, 2007 Share Posted September 30, 2007 re-explain. Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-358434 Share on other sites More sharing options...
corkg Posted September 30, 2007 Author Share Posted September 30, 2007 Okay I have a date in the future: 2007/09/31 13:10:55 How do i convert that to how many seconds it is in the future. Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-358441 Share on other sites More sharing options...
BlueSkyIS Posted September 30, 2007 Share Posted September 30, 2007 $secsfromnow = strtotime(2007/09/31 13:10:55) - time(); Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-358451 Share on other sites More sharing options...
corkg Posted October 1, 2007 Author Share Posted October 1, 2007 What you gave me did not work. I need a string from the time Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-359227 Share on other sites More sharing options...
BlueSkyIS Posted October 1, 2007 Share Posted October 1, 2007 I provided the solution for this: Okay I have a date in the future: 2007/09/31 13:10:55. How do i convert that to how many seconds it is in the future. it sounds like you don't actually need seconds. what do you need?? re-explain. Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-359230 Share on other sites More sharing options...
corkg Posted October 1, 2007 Author Share Posted October 1, 2007 That is what i want but it dos not work Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-359239 Share on other sites More sharing options...
corkg Posted October 1, 2007 Author Share Posted October 1, 2007 Parse error: syntax error, unexpected T_LNUMBER Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-359240 Share on other sites More sharing options...
d.shankar Posted October 1, 2007 Share Posted October 1, 2007 $secs = strtotime("2007/09/31 13:10:55"); echo $secs; Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-359242 Share on other sites More sharing options...
BlueSkyIS Posted October 1, 2007 Share Posted October 1, 2007 ah "it does not work" doesn't provide very much info. My mistake was missing double-quotes: $secsfromnow = strtotime("2007/09/31 13:10:55") - time(); Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-359256 Share on other sites More sharing options...
sKunKbad Posted October 1, 2007 Share Posted October 1, 2007 <?php $futureDate = "2007/10/2 13:10:50"; $futureD = strtotime($futureDate); $now = time(); echo "The number of seconds till ". $futureDate ." is ". ($futureD - $now); ?> Link to comment https://forums.phpfreaks.com/topic/71248-date/#findComment-359301 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.