Jump to content

Recommended Posts

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

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 by Barand
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.