Private
Public Access
1
0

updated time zone in sync

This commit is contained in:
Sander Roosendaal
2017-09-24 17:45:59 +02:00
parent db76e90411
commit 3b0763ade2
5 changed files with 17 additions and 8 deletions

View File

@@ -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,