View Single Post
  #17  
Old 7th November 2020, 11:31 PM
Shaun Shaun is offline
Member
 
Join Date: Jan 1970
Location: Western Australia
Posts: 3,456
Default

Quote:
Originally Posted by Playlife
EDIT, I do apologise, this only seems to work for VIC.


Hi Shaun, great job.

Unfortunately the move to this new API killed my excel/VBA work as well. I'm new to python, slowly learning the ropes.

It is as clunky as hell, and is manually coded, but using your script I have added the start time. Programmers will wince at how bad this is (sorry!). There's easier ways to do timezone conversions so I have read but cannot wrap my head around it yet.


**** inserted into # race info ****
race_StartTime = race1["raceStartTime"]
****
d1 = datetime.datetime.strptime(race_StartTime,"%Y-%m-%dT%H:%M:%S.%fZ")
new_format = "%H:%M"
HourOnly = "%H"
MinuteOnly = "%M"
Hour = str(int(d1.strftime(HourOnly))+11) # This is for Victoria AEDT (+11 hrs GMT)
Minute = d1.strftime(MinuteOnly)
race_StartTime = "Jump:" + Hour + ":" + Minute

raceStartTime = Label(inputFrame, text=str(race_StartTime), width=25, bg="darkblue", fg="white", font=("bold", 11), anchor=W)
raceStartTime.grid(row=0, column=20)

****


Cheers, this is the same reason i didn't add the time as yet because of time zones, but anyone could adjust this code to suit there own time zone, that issue i was having with the bug had to do with refreshing, the problem i had was when you change races it started another time refresh sequence, probably a simple fix when i work it out.
__________________
One Drive

"If the corporates are treating you poorly , just go elsewhere."
"If they need you , they will soon find out."
"If you need them , you will soon find out."
--moeee
_______________________________________________
Reply With Quote