d_barszczak Posted July 26, 2006 Share Posted July 26, 2006 I know this is such a simple problem as i have done it in the past and also seen it here but can't remember how i did it and cant seem to find it here.Basically i have a $datenow = date("U") and i would like to minus 5 minutes from this.Does anybody know how??? Link to comment https://forums.phpfreaks.com/topic/15675-simple-date-problem/ Share on other sites More sharing options...
redarrow Posted July 26, 2006 Share Posted July 26, 2006 <?$min=date("i")-5;$date_now=date("h:$min:s");echo $date_know;?> Link to comment https://forums.phpfreaks.com/topic/15675-simple-date-problem/#findComment-63928 Share on other sites More sharing options...
d_barszczak Posted July 26, 2006 Author Share Posted July 26, 2006 ok,if date("i") is say 1 this wont give me -4 will it? Link to comment https://forums.phpfreaks.com/topic/15675-simple-date-problem/#findComment-63929 Share on other sites More sharing options...
redarrow Posted July 26, 2006 Share Posted July 26, 2006 $h=date("h");$m=date("i")-5;$s=date("s");$date_now=date("$h: $m: $s");echo $date_now; Link to comment https://forums.phpfreaks.com/topic/15675-simple-date-problem/#findComment-63935 Share on other sites More sharing options...
d_barszczak Posted July 26, 2006 Author Share Posted July 26, 2006 Hi,That method don't work but sorted it now anyway.[code]$min = date("U")-60*5;echo date("g:i:s A");echo "<br>";echo date("g:i:s A", $min)[/code] Link to comment https://forums.phpfreaks.com/topic/15675-simple-date-problem/#findComment-63939 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.