Well the data is there, the processing is a bit troublesome due to our calendar system being crap.
First parse out the relevant information and save to a data structure (array or variable). You'll want to grab the month, year, and day. I don't think you'll need the time. My goal is to convert everything strictly to number of days.
For each month, you want to convert it to however many days there were BEFORE that month in a year. Lets call these monthDays:
Jan=0, Feb=31, Mar=59, Apr=90, May=121, June=151, ect...
So to get the date in days, you would do year*365+monthDays+day. You then compare this final number to the previous one.
How to deal with leap years and February 29 eludes my limited brainpower at the moment. I imagine it would have to do with using modulo (%) or another set of conditional logic, but yeah... the calendar system is bonkers. Hopefully you get the idea.