3:30 Newmarket - what object is this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Burdett
    Junior Member
    • Sep 2012
    • 29

    #1

    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
    Junior Member
    • Sep 2012
    • 29

    #2
    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.

    Comment

    • Burdett
      Junior Member
      • Sep 2012
      • 29

      #3
      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.

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        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.

        Comment

        • only1jake
          Junior Member
          • Nov 2016
          • 29

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

          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.

          selectedtimezone = TimeZoneInfo.FindSystemTimeZoneById(chosentimezone )
          currentconvertedTime = TimeZoneInfo.ConvertTimeFromUtc(Date.UtcNow, selectedtimezone)

          Comment

          • Burdett
            Junior Member
            • Sep 2012
            • 29

            #6
            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.

            Comment

            Working...
            X