I'm attempting to pass a datetime string with a timezone offset into a Django url as a query param as follows:
http://0.0.0.0:8080/coordinates/12.231/34.322/?obstime=2021-06-10T18:39:41+1000
I'm attempting to parse this in the view as follows:
datetime.datetime.strptime(
self.request.query_params.get('obstime'),
"%Y-%m-%dT%H:%M:%S %z"
).isoformat()
So I'm utilising the format "%Y-%m-%dT%H:%M:%S %z".
I thought this would work, however I am seeing the following error:
time data '2021-06-10T18:39:41 1000' does not match format '%Y-%m-%dT%H:%M:%S %z'
I've tried to search for potential fixes for this error, but so far everything has come up dry.
Does anyone know the correct format I need to pass in to either the url endpoint or to the datetime.datetime.strptime()
function...