Do not work with date strings, work with the instance of the structure
System.DateTime
. Those strings should appear only when you about to display data on screen (in HTML, for most typical case).
The instances of
DataTime
can be compared with operators '==', '!=', '<', '>', '<=' or '>='.
You can also subtract two points in time to get an instance of the structure
System.TimeSpan
representing the distance in time between them. The most readable way of doing such subtraction is, no surprise, the operator '-' (minus). If you subtract earlier time from later time the result is positive, negative in the opposite case.
Please see:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.timespan.aspx[
^].
—SA