# importe datetime from datetime import datetime # create two datetime before = datetime(2010, 12, 27, 14, 39, 19, 700401) after = datetime.now() # test if(before>after): ... if(before<after): ...