fixed time zone stuff
This commit is contained in:
@@ -9077,11 +9077,15 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
rankingpiece =- Workout.objects.get(id=id).rankingpiece
|
rankingpiece =- Workout.objects.get(id=id).rankingpiece
|
||||||
|
|
||||||
startdatetime = (str(date) + ' ' + str(starttime))
|
startdatetime = datetime.datetime.combine(
|
||||||
startdatetime = datetime.datetime.strptime(startdatetime,
|
date,starttime
|
||||||
"%Y-%m-%d %H:%M:%S")
|
)
|
||||||
|
|
||||||
startdatetime = startdatetime.replace(tzinfo=pytz.timezone(thetimezone))
|
startdatetime = pytz.timezone(thetimezone).localize(
|
||||||
|
startdatetime
|
||||||
|
)
|
||||||
|
|
||||||
|
print startdatetime
|
||||||
try:
|
try:
|
||||||
# aware object can be in any timezone
|
# aware object can be in any timezone
|
||||||
out = startdatetime.astimezone(pytz.utc)
|
out = startdatetime.astimezone(pytz.utc)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ def get_metar_data(airportcode,unixtime):
|
|||||||
url += str(unixtime+3600)
|
url += str(unixtime+3600)
|
||||||
url += "&stationString="+airportcode
|
url += "&stationString="+airportcode
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s = requests.get(url)
|
s = requests.get(url)
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user