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. Quote 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 (edited) 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 Edited February 22, 2013 by Barand Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.