Obviously I can get the date and time from datetime.datetime.now(), but I don’t actually care about the seconds or especially microseconds.
Is there somewhere I can easily get Date+Hour+Minute?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can clear down the second and microsecond component of a datetime value like so:
This would allow you to compare datetimes to minute granularity.
If you just want to print the date without a second/microsecond component, then use the appropriate format string: