Betfair Developers


Exchange API
Discussion about the Betfair Sports Application Programming Interface - API NG

Post Reply
Burdett Burdett is offline
Junior Member
 
Default 3:30 Newmarket - what object is this?

Hi

I can get a marketID, the horse selectionId's and horse names to screen, but am having issue with tagging the time and race meeting to the data, as in subject line:
3:30pm Newmarket

What object must I grab, if say using the extensions of MarketCatalogue[0] ........?

I tried marketCatalogues[0].MarketName.ToString(), but got "R8 6f Allw Claim" and not what I wanted.

Any help appreciated.

David.
Burdett Burdett is offline
Junior Member
 
Default Got the name now

Hi

Just to update, I have now added the following to my marketprojections data request options i.e.
marketProjections.Add(MarketProjection.EVENT);

This has now populated the venue information, when I try:

string horseRaceVenue = marketCatalogues[0].Event.Venue;

Previously, the information was null as I'd not requested this level of information.

But, I am still struggling to get the time of the meeting right, i.e. the 3:30pm.

Again, any help appreciated.....

Thanks in advance,

David.
Burdett Burdett is offline
Junior Member
 
Default Got the racetime now

Ah - again, I've added to the..............
ISet<MarketProjection> marketProjections = new HashSet<MarketProjection>();

By adding the following:
marketProjections.Add(MarketProjection.MARKET_DESC RIPTION);

I've been able to select the following now populated information:
var marketTime = marketCatalogues[0].Description.MarketTime;

Its currently one hour out for the US market, so I've done
MarketTime.AddHours(1), but will have to code this more sensibly as I guess the UK market could show one hour to early? so better check the other locations and code up for geographical differences, if its not a direct BST correction. Will do a bit more research on this.

David.
jabe jabe is offline
Senior Member
 
Default

If you're using .NET, there's an option to convert from local time to UTC. Someone posted about it a few weeks back. Try a search for UTC on the whole forum and you should find it.
only1jake only1jake is offline
Junior Member
 
Default

Yep, can confirm the Betfair times are in UTC. I'm thinking you are using C# so you can do something like this:

Quote:
DateTime d = DateTime.Now;

DateTime u = d.ToUniversalTime;

DateTime nd = u.ToLocalTime;
in my current program I use TimeZone infos, which allows you to specify the timezone from the computers registry and convert to and from UTC etc:
(this is vb.net tho)

So I'd specify a timezone, Ie. "AUS Eastern Standard Time" which is chosentimezone and you can then use built in functions to convert.

Quote:
selectedtimezone = TimeZoneInfo.FindSystemTimeZoneById(chosentimezone )
currentconvertedTime = TimeZoneInfo.ConvertTimeFromUtc(Date.UtcNow, selectedtimezone)
Burdett Burdett is offline
Junior Member
 
Default Utc

Cheers JABE / Jake

Have implemented your good advice. I suppose using UTC will eventually make my code cope better when the clocks roll back again in October.

Thanks

Burdett.
Post Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump