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

@@ -258,7 +258,7 @@ def createc2workoutdata_as_splits(w):
"date": w.startdatetime.isoformat(),
"distance": int(w.distance),
"time": int(10*makeseconds(durationstr)),
"timezone": "Etc/UTC",
"timezone": w.timezone,
"weight_class": c2wc(w.weightcategory),
"comments": newnotes,
"heart_rate": {
@@ -320,7 +320,7 @@ def createc2workoutdata(w):
data = {
"type": workouttype,
"date": w.startdatetime.isoformat(),
"timezone": "Etc/UTC",
"timezone": w.timezone,
"distance": int(w.distance),
"time": int(10*makeseconds(durationstr)),
"weight_class": c2wc(w.weightcategory),

View File

@@ -2,6 +2,7 @@
# Python
import oauth2 as oauth
import pytz
import cgi
import requests
import requests.auth
@@ -231,7 +232,8 @@ def createrunkeeperworkoutdata(w):
}
distancedata.append(point)
start_time = w.startdatetime.strftime("%a, %d %b %Y %H:%M:%S")
st = w.startdatetime.astimezone(pytz.timezone(w.timezone))
start_time = st.strftime("%a, %d %b %Y %H:%M:%S")
try:
newnotes = w.notes+'\n from '+w.workoutsource+' via rowsandall.com'

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,

View File

@@ -12,6 +12,7 @@ from datetime import timedelta
import numpy as np
from dateutil import parser
import time
import pytz
import math
import gzip
from math import sin,cos,atan2,sqrt

View File

@@ -3,6 +3,7 @@
# Python
import oauth2 as oauth
import cgi
import pytz
import requests
import requests.auth
import json
@@ -285,7 +286,8 @@ def createunderarmourworkoutdata(w):
for e in zip(t,spm):
spmdata.append([e[0],e[1]])
start_time = w.startdatetime.isoformat()
st = w.startdatetime.astimezone(pytz.timezone(w.timezone))
start_time = st.isoformat()
timeseries = {
"distance": distancedata,