I have a line of code here that works on my dev server for Django and Python using SQL Lite, however when I upload my code it gives me an error about my time zone . Here is my Code. Postgres doesn't like the %z at the end , however SQL Lite its fine. What do I do to fix this on my Heroku Postgres Production Environment? Thanks
new_event.start = datetime.strptime(str(obj.start_date) ,'%Y-%m-%d %H:%M:%S%z')
Error Message: time data '2020-10-08 12:17:51-04:00' does not match format '%Y-%m-%d %H:%M:%S%z'
%zas it has a colon in it. This has actually changed in Python 3.7:datetime.strptime('2020-10-08 12:17:51-04:00' ,'%Y-%m-%d %H:%M:%S%z') datetime.datetime(2020, 10, 8, 12, 17, 51,tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000)))new_event.start= a datetime. So why not just:new_event.start=obj.start_date? It gets you the same result.