mmainstreet Posted February 22, 2013 Share Posted February 22, 2013 Hi, i want to compare current time and an old time. Both are in "H i s m d Y" Format. d Day of month, a number with leading zeroes 20 H Hour (24-hour format - leading zeroes) 22 i Minutes ( 0 - 59 ) 23 m Month of year (number - leading zeroes) 1 s Seconds of hour 20 Y Year (four digits) 2006 I read the old time from an .txt file. $timeOld = fgets($dateizeiger, 4096); $time = date("H i s m d Y",$t); Now I want the difference in the same format. Sorry for my bad english. I would be glad of any help. Link to comment https://forums.phpfreaks.com/topic/274816-compare-time-in-h-i-s-m-d-y-format/ Share on other sites More sharing options...
Barand Posted February 22, 2013 Share Posted February 22, 2013 If you want to compare then they need to in a format that would sort into the correct sequence. That format will not. use yyyy-mm-dd hh:ii:ss when storing dates. Format as required on final output Link to comment https://forums.phpfreaks.com/topic/274816-compare-time-in-h-i-s-m-d-y-format/#findComment-1414152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.