updated time zone in sync
This commit is contained in:
@@ -16,6 +16,7 @@ from math import sin,cos,atan2,sqrt
|
||||
|
||||
import urllib
|
||||
import c2stuff
|
||||
import pytz
|
||||
|
||||
# Django
|
||||
from django.shortcuts import render_to_response
|
||||
@@ -214,6 +215,8 @@ def get_sporttracks_workout(user,sporttracksid):
|
||||
|
||||
# Create Workout Data for upload to SportTracks
|
||||
def createsporttracksworkoutdata(w):
|
||||
timezone = pytz.timezone(w.timezone)
|
||||
|
||||
filename = w.csvfilename
|
||||
try:
|
||||
row = rowingdata(filename)
|
||||
@@ -283,12 +286,14 @@ def createsporttracksworkoutdata(w):
|
||||
except TypeError:
|
||||
w.notes = 'from '+w.workoutsource+' via rowsandall.com'
|
||||
|
||||
st = w.startdatetime.astimezone(timezone)
|
||||
st = st.replace(microsecond=0)
|
||||
|
||||
if haslatlon:
|
||||
data = {
|
||||
"type": "Rowing",
|
||||
"name": w.name,
|
||||
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
||||
"start_time": w.startdatetime.isoformat(),
|
||||
"start_time": st.isoformat(),
|
||||
"total_distance": int(w.distance),
|
||||
"duration": duration,
|
||||
"notes": w.notes,
|
||||
@@ -303,8 +308,7 @@ def createsporttracksworkoutdata(w):
|
||||
data = {
|
||||
"type": "Rowing",
|
||||
"name": w.name,
|
||||
# "start_time": str(w.date)+"T"+str(w.starttime)+"Z",
|
||||
"start_time": w.startdatetime.isoformat(),
|
||||
"start_time": st.isoformat(),
|
||||
"total_distance": int(w.distance),
|
||||
"duration": duration,
|
||||
"notes": w.notes,
|
||||
|
||||
Reference in New Issue
Block a user