Forums

Developers

There is currently 1 person viewing this thread.
MacJack
17 Aug 18 17: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?

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 5
By:
jabe
When: 18 Aug 18 04:03
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)
By:
FinalWhistle
When: 21 Aug 18 20:39
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
By:
FinalWhistle
When: 21 Aug 18 20:41
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
By:
jabe
When: 23 Aug 18 12:29
Is there somewhere where Betfair posts changes to the API? Since the developers' forum got canned I've seen nothing.
By:
11kv
When: 05 Nov 18 16:27
[img/]https://community.cdnbf.net/community.betfair.com/user/11kv/0cdd2584abee7a80a4b08cbf07b26b47.jpg?v=270000[img/]
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com