I'm working with an API that passes me a time/date field that they cannot guarantee will always have timezone info in it.
From their docs, this field could be either:
Empty String,
YYYY-MM-DD,
YYYY-MM-DDTHH:MM:SS, or
YYYY-MM-DDTHH:MM:SS+TIMEZONE
When I try to save that field to my model in the database it generates this error in the case where the data comes without timezone information. The field I'm saving this value into is defined in its model as:
my_timedate_field = models.DateTimeField()
At a minimum I'd like to suppress the warnings from being generated with each record saved. Is there anything specific I can do to make this a bit cleaner?
Edit: The warnings are:
RuntimeWarning: DateTimeField my_timedate_field received a naive datetime while time zone support is active. RuntimeWarning)
These warnings show up in my logs every time I process an api call -- sometimes 5-10 times per api call given how the elements show up.