Tasos Sangiotis

Python instance check

Django comparisons almost always require timezone aware datetimes.

I tried with a None value but the comparison failed.

A workaround to keep this compatible is to use epoch and isoparse with the timezone in the ISO string.

from dateutil import parser
check_date = parser.isoparse("1970-01-01T00:00:00+03:00")
Get notified on future posts from me

To make a comment, please send an e-mail using the button below. Your e-mail address won't be shared and will be deleted from my records after the comment is published. If you don't want your real name to be credited alongside your comment, please specify the name you would like to use. If you would like your name to link to a specific URL, please share that as well. Thank you.

Comment via email