Forums

Developers

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
MacJack
17 Aug 18 16:08
Joined:
Date Joined: 28 May 03
| Topic/replies: 1 | Blogger: MacJack's blog
This has been happening for the last couple of weeks intermittently.

I download today's fixtures using the api-ng and some of the games show kickoff time an hour later than they actually are. Example today:

Danish Super League: Sonderjyske v Vendsyssel : aping ko = 19.00. Actual ko = 18.00

Anyone else experiencing this?
Share |
Pause Switch to Standard View Soccer kickoff times incorrect
Show More
Loading...
Report jabe August 18, 2018 4:03 AM BST
Yes, just checked a few. It did take me some time to decide how to adjust for British Summer Time in VB.NET, but the following sorted that out:

kickoff = inrec.openDate.tolocaltime ' should put games at correct BST/GMT time (converts GMTakaUTC to local)

However, the start times of some games don't agree with Flashscores. For instance, the kickoff for

Vejgaard v Sydvest in Denmark kicks off at noon according to FlashScores, but my program has converted it to 1pm.
Kjellerup v Dalum, also in Denmark, appears to be wrong.

This Russian youth team game shows as 9:00am but Flashscores says 8:00am:
FK Krasnodar (Y) v Spartak Moscow (Y)
Report FinalWhistle August 21, 2018 8:39 PM BST
Betfair have started to use the "Timezone" property along with the "OpenDate" property to specify kick-off times in the "EventResult" object.

Until recently I have only ever seen "Timezone" specified as "Europe/London" but now some events wil have a "GMT" timezone specified.

The other factor involved in this is how your Json DeSerializer works on DateTime properties that have no timezone specification because the "OpenDate" property is only returned in the json in "yyyy-MM-dd HH:mm:ss" format with no timezone specified.
I use Newtonsoft.Json and a DateTime in the format "yyyy-MM-dd" is deserialized to a DateTime with a Kind property of DateTimeKind.Utc.
This may be different for other deserializers, for instance they may default to DateTimeKind.Local, so you need to check.

"Europe/London" is a Utc DateTime (not adjusted for BST) and so when I have an "OpenDate" with a DateTimeKind.Utc there is no conversion to be done and so something like this will work.

DateTime localtime = OpenDate.ToLocalTime();

When Betfair have a timezone of "GMT" they are specifying a time that is adjusted for BST but the "OpenDate" property has a DateTimeKind.Utc and so
OpenDate.ToLocalTime(); will be one hour out while we are in BST.
I am based in the UK and only use my software for my own use and so I can convert the "GMT" times as follows:

DateTime localTime = DateTime.SpecifyKind(OpenDate, DateTimeKind.Local);

which is equivalent to:

DateTime localTime = new DateTime(OpenDate.Ticks, DateTimeKind.Local);

This is not a complete solution as Betfair may use other Timezones in the future, for example they may use "Europe/Berlin" for German kick-off times.
The correct way for .NET applications would be to convert the olson timezone such as "Europe/Berlin" to its .NET equivalent which is "W. Europe Standard Time" and then perform the converstion using the TimeZoneInfo class.

Hope that helps
Report FinalWhistle August 21, 2018 8:41 PM BST
Betfair have started to use the "Timezone" property along with the "OpenDate" property to specify kick-off times in the "EventResult" object.

Until recently I have only ever seen "Timezone" specified as "Europe/London" but now some events wil have a "GMT" timezone specified.

The other factor involved in this is how your Json DeSerializer works on DateTime properties that have no timezone specification because the "OpenDate" property is only returned in the json in "yyyy-MM-dd HH:mm:ss" format with no timezone specified.
I use Newtonsoft.Json and a DateTime in the format "yyyy-MM-dd" is deserialized to a DateTime with a Kind property of DateTimeKind.Utc.
This may be different for other deserializers, for instance they may default to DateTimeKind.Local, so you need to check.

"Europe/London" is a Utc DateTime (not adjusted for BST) and so when I have an "OpenDate" with a DateTimeKind.Utc there is no conversion to be done and so something like this will work.

DateTime localtime = OpenDate.ToLocalTime();

When Betfair have a timezone of "GMT" they are specifying a time that is adjusted for BST but the "OpenDate" property has a DateTimeKind.Utc and so
OpenDate.ToLocalTime(); will be one hour out while we are in BST.
I am based in the UK and only use my software for my own use and so I can convert the "GMT" times as follows:

DateTime localTime = DateTime.SpecifyKind(OpenDate, DateTimeKind.Local);

which is equivalent to:

DateTime localTime = new DateTime(OpenDate.Ticks, DateTimeKind.Local);

This is not a complete solution as Betfair may use other Timezones in the future, for example they may use "Europe/Berlin" for German kick-off times.
The correct way for .NET applications would be to convert the olson timezone such as "Europe/Berlin" to its .NET equivalent which is "W. Europe Standard Time" and then perform the converstion using the TimeZoneInfo class.

Hope that helps
Report jabe August 23, 2018 12:29 PM BST
Is there somewhere where Betfair posts changes to the API? Since the developers' forum got canned I've seen nothing.
Report 11kv November 5, 2018 4:27 PM GMT
[img/]https://community.cdnbf.net/community.betfair.com/user/11kv/0cdd2584ab...
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com