Brutal 164 Posted September 1, 2013 Report Share Posted September 1, 2013 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,20132-fulldate: 11,4,2012 or 1-fulldate: 12,12,20122-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. Quote Link to post Share on other sites
bestmacros 60 Posted September 1, 2013 Report Share Posted September 1, 2013 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) Quote Link to post Share on other sites
Brutal 164 Posted September 1, 2013 Author Report Share Posted September 1, 2013 Thanks BestMacros Quote Link to post Share on other sites
UBotDev 276 Posted September 1, 2013 Report Share Posted September 1, 2013 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 Quote Link to post Share on other sites
Brutal 164 Posted September 1, 2013 Author Report Share Posted September 1, 2013 Thanks UbotDev... I'm giving it a go. Update: Man your plugin saved me a massive amount of work - Thanks! Quote Link to post Share on other sites
UBotDev 276 Posted September 2, 2013 Report Share Posted September 2, 2013 Np, I'm glad you like it....that's why it was created. Quote Link to post Share on other sites
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.