Compare dates

0 votes
How to compare two dates in python?
Jun 14, 2018 in Python by nightshade
• 870 points
15 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
>>> from datetime import datetime
>>> past = datetime.now()
>>> present = datetime.now()
>>> past < present
True
answered Jun 14, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

How can I compare the content of two files in Python?

Assuming that your file unique.txt just contains ...READ MORE

answered Apr 16, 2018 in Python by charlie_brown
• 7,710 points
45 views
0 votes
1 answer

Write dates as datetime objects

from datetime import datetime datetime_object = datetime.strptime('Aug 23 ...READ MORE

answered Apr 18, 2018 in Python by Nietzsche's daemon
• 4,260 points
10 views
0 votes
1 answer

Number of days between dates in Python

You can use the date module to ...READ MORE

answered May 30, 2018 in Python by Nietzsche's daemon
• 4,260 points
25 views
0 votes
1 answer

Which is better if we compare C vs Python?

It depends on what do you expect ...READ MORE

answered Mar 6 in Python by SDeb
• 11,160 points
8 views
0 votes
1 answer

how to compare two strings in python?

compare two string in python >>> s1="abc ...READ MORE

answered Mar 25 in Python by rajesh
• 1,210 points
29 views
0 votes
1 answer
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
69 views
+4 votes
6 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.