Jump to content
UBot Underground

Recommended Posts

I can't seem to get my mind around how to compare 2 dates to determine which is older/newer.

 

Date format is currently set as

 

1-fulldate: 1,9,2013

2-fulldate: 11,4,2012

 

or

 

1-fulldate: 12,12,2012

2-fulldate: 1,19,2012

 

I can of course break this down into day,month,year easily enough, but can't figure how to compare them in a reasonable way in order to know which date is older or newer than the other.

 

Any ideas would be greatly appreciated.

Link to post
Share on other sites

you can do 3-level compare:

1. by year (if year of A is bigger than B, than A is bigger, if year is equal go to month compare)

2. by month (if month of A is bigger than B, A is bigger, if month is equal go to date compare)

3. by date (same as above)

Link to post
Share on other sites

You can use my plugin and convert both dates to UNIX format (use custom format specifier for input date), then you subtract date1 from date2; if result is positive, date2 > date1, if negative date1>date2, if 0 dates are the same.

 

You can find more about plugin here:

http://ubotdev.com/free-plugin-datetime-manipualtion

Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...