I have a UTCDateTime object in python and I need to check if it is after today but within the next year. What is the best way to achieve this?
Thanks in advance
Changed from 13 months to 1 year.
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.
although… this will still fail if you run it on, say, January 31st since February 31st doesn’t exist. There are a few conditions you can add related to month dependencies to avoid these problems.
If you changed it to 12 months (re: comment), you only have to worry about leap years.