corkg Posted September 29, 2007 Share Posted September 29, 2007 Hi I want to have a date set with a variable added on to it, which is formated date('Y-m-d H:i:s'); and then it can decifer this date to show how long is left, Thanks Quote Link to comment https://forums.phpfreaks.com/topic/71192-solved-date/ Share on other sites More sharing options...
Fadion Posted September 29, 2007 Share Posted September 29, 2007 U could give a real example and a better explanation. Probably u need strototime() or mktime(). Quote Link to comment https://forums.phpfreaks.com/topic/71192-solved-date/#findComment-358099 Share on other sites More sharing options...
corkg Posted September 29, 2007 Author Share Posted September 29, 2007 Okay For example when you click a button it generates a random number of seconds = rand(100,6000) and it adds the random number of seconds to the date now date('Y-m-d H:i:s'); Quote Link to comment https://forums.phpfreaks.com/topic/71192-solved-date/#findComment-358100 Share on other sites More sharing options...
Fadion Posted September 29, 2007 Share Posted September 29, 2007 $sec = rand(100, 6000); $newtime = date('Y-m-d H:i:s', strototime("+$sec seconds")); didnt try it as i cant now, but it shoud work. Quote Link to comment https://forums.phpfreaks.com/topic/71192-solved-date/#findComment-358103 Share on other sites More sharing options...
corkg Posted September 30, 2007 Author Share Posted September 30, 2007 I don't have access to my files right now to test it, but all i want is the time + the amount of seconds which is then converted to time format. Quote Link to comment https://forums.phpfreaks.com/topic/71192-solved-date/#findComment-358298 Share on other sites More sharing options...
corkg Posted September 30, 2007 Author Share Posted September 30, 2007 All it did was give the time now. Quote Link to comment https://forums.phpfreaks.com/topic/71192-solved-date/#findComment-358301 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.