Fixed the order of the date and time component comparisons.
Added some adatetime unit tests.