Do not work with date strings, work with the instance of the structure
. Those strings should appear only when you about to display data on screen (in HTML, for most typical case).
The instances of
can be compared with operators '==', '!=', '<', '>', '<=' or '>='.
You can also subtract two points in time to get an instance of the structure
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.