Forum Topic - FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule: (7 Items)
   
FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule  
As documented by the API docs, actualMatchTime should be in the event's local timezone. The XML endpoint returns the 
correct value: https://frc-api.firstinspires.org/v2.0/2016/schedule/scmb/qual/hybrid shows:

<actualStartTime>2016-02-26T09:09:14.483</actualStartTime>
<description>Qualification 1 (A)</description>
<matchNumber>1</matchNumber>
<scoreBlueAuto>10</scoreBlueAuto>
<scoreBlueFinal>44</scoreBlueFinal>
<scoreBlueFoul>0</scoreBlueFoul>
<scoreRedAuto>20</scoreRedAuto>
<scoreRedFinal>52</scoreRedFinal>
<scoreRedFoul>5</scoreRedFoul>
<startTime>2016-02-26T09:00:00</startTime>

However, the json endpoint is incorrect. For the same endpoint it shows:
{u'tournamentLevel': u'Qualification', u'scoreBlueFoul': 10, u'matchNumber': 1, u'scoreBlueAuto': 10, u'description': 
u'Qualification 1 (D)', u'scoreRedAuto': 0, u'scoreRedFoul': 0, u'scoreRedFinal': 40, u'startTime': u'2016-03-11T09:00:
00', u'scoreBlueFinal': 66, u'Teams': [{u'dq': False, u'surrogate': False, u'station': u'Red1', u'teamNumber': 6141}, 
{u'dq': False, u'surrogate': False, u'station': u'Red2', u'teamNumber': 5596}, {u'dq': False, u'surrogate': False, 
u'station': u'Red3', u'teamNumber': 5428}, {u'dq': False, u'surrogate': False, u'station': u'Blue1', u'teamNumber': 
5580}, {u'dq': False, u'surrogate': False, u'station': u'Blue2', u'teamNumber': 4476}, {u'dq': False, u'surrogate': 
False, u'station': u'Blue3', u'teamNumber': 4015}], u'actualStartTime': u'2016-03-11T04:06:42.63'}


I haven't had the chance to check if the Match Results endpoint has the same issue.
Re: FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule  
Actually upon closer inspection, it may just be that ONTO has wrong actualStartTime for both XML and JSON.
Re: FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule  
Hi Eugene,
I've checked many events and they're all returning properly for JSON and XML. You're right that oNTO does appear to have
 weird times in the actual, even though Scheduled is correct. We'll check with the event when time allows, as it's 
possible the timezone has been inadvertently changed (in which case it would upload "bad" time).
Thanks,
Re: FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule  
This is still a bug.
And it's worse.
I just pulled this data...
https://frc-api.firstinspires.org/v2.0/2016/schedule/MIMID/qual/hybrid

The response was ...
"Schedule": [
    {
      "description": "Qualification 1 (B)",
      "tournamentLevel": "Qualification",
      "matchNumber": 1,
      "startTime": "2016-03-18T11:00:00",
      "actualStartTime": "2016-03-18T07:00:00.453",
      "scoreRedFinal": 51,
      "scoreRedFoul": 5,
      "scoreRedAuto": 10,
      "scoreBlueFinal": 82,
      "scoreBlueFoul": 0,
      "scoreBlueAuto": 6,

startTime is in the local time zone (Eastern)
actualStartTime is not in UTC since UTC would be "2016-03-18T15:00:00.453"
It's not in local time since that would be ""2016-03-18T11:00:00.453"
The actual time is being calculated as if the background time WAS UTC then subtracting 4 hours to try and make it local.


This is why my feature request to simply make all times UTC with a timezone offset should be considered. Makes time 
calculations so much easier and take the burden of time conversations off the API.
Re: FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule  
Alright, this already corrected itself.
I refreshed the query and it returned...
"Schedule": [
    {
      "description": "Qualification 1 (B)",
      "tournamentLevel": "Qualification",
      "matchNumber": 1,
      "startTime": "2016-03-18T11:00:00",
      "actualStartTime": "2016-03-18T11:00:00.453",
      "scoreRedFinal": 51,
      "scoreRedFoul": 5,
      "scoreRedAuto": 10,
      "scoreBlueFinal": 82,
      "scoreBlueFoul": 0,
      "scoreBlueAuto": 6,


Any reason why it was wrong for a period of time?
Re: FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule  
Hi,
The times are working fine for me- see attached. Maybe your browser or library is trying to do some sort of offset for 
your machine's time? 

We don't "change" times once they're uploaded by the truck, so there's no expected behavior of "changed" times unless 
the match is replayed on site.
Attachment: Image dean.png 45.18 KB
Re: FRCAPI actualMatchTime is in UTC instead of Local timezone in HyridSchedule  
No, I am using PostMan from Google and all it does it send the query and directly display the response.

All I did to get the data for the second time was refresh the query. The program would not have done some sort of 
automatic adjustment on the first query and then not on the second.

So it is true that for a short period of time the 'actualStartTime' was incorrect.

I know non-repeatable bugs like this are hard to track down and maybe the source of the error was human at the data 
entry point. Maybe just an unfortunate typo that made it appear like a computational error.

If I see the error again I will post about it.