Invalid marketStartTime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • khughes
    Junior Member
    • Aug 2009
    • 36

    #1

    Invalid marketStartTime

    Hi
    Am I correct in thinking that the marketCatalogue marketStartTime is always GMT? And includes daylight saving adjustments?

    The marketStartTime returned for an event tomorrow is 29/03/2015 at 01:09 but as the daylight saving comes into effect at 1am then the period from 1am to 2am effectively does not exist. So is this an error or am I missunderstanding the way times are returned by API-NG? This is causing me a problem with datetime conversions.

    Here is the JSon request and response:

    Request: {"method":"SportsAPING\/v1.0\/listMarketCatalogue","params":{"filter":{"marketTy peCodes":["WIN"],"marketStartTime":{"to":"2015-03-29T03:00:00.000+01:00","from":"2015-03-29T00:46:00.000Z"},"eventIds":["27407991"],"eventTypeIds":["7"]},"maxResults":1000,"marketProjection":["COMPETITION","EVENT","EVENT_TYPE","MARKET_START_T IME"],"sort":"FIRST_TO_START"},"id":"1","jsonrpc":"2.0" }

    Response: {"jsonrpc":"2.0","result":[{"marketId":"1.117974712","marketName":"R8 1m Mdn Claim","marketStartTime":"2015-03-29T01:10:00.000Z","totalMatched":0.0,"eventType":{ "id":"7","name":"Horse Racing"},"event":{"id":"27407991","name":"Penn (US) 28th Mar","countryCode":"US","timezone":"US/Eastern","venue":"Penn National","openDate":"2015-03-28T22:00:00.000Z"}}],"id":"1"}
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    Market start times are UTC times and therefore 01:10 tomorrow is perfectly valid.

    The local time of that event will be 02:10 but the UTC time is non-adjusted. That way market start times are always correct wherever you are in the world.

    Standard functions exist in most languages to convert date/times to/from UTC.

    Comment

    • khughes
      Junior Member
      • Aug 2009
      • 36

      #3
      Hi Betdynamics,

      Thanks for your reply.
      Yes that makes perfect sense. I have found that the problem is actually the function I am using to convert from a UTC string to a local DateTime. It works fine and caters for daylight saving unless the UTC time happens to fall in the 'non-existent DST time period', as in this case. So it's not an API issue at all, just a small headache for me!

      Regards
      Kevin

      Comment

      • betdynamics
        Junior Member
        • Sep 2010
        • 534

        #4
        What O/S and language are you using?

        If Windows/C#, then retrieve the date as a UTC date and then use the DateTime ToLocalTime() method to convert to the local time.

        Comment

        • khughes
          Junior Member
          • Aug 2009
          • 36

          #5
          I'm using Windows/Delphi and I've solved the problem now. It is a known bug in the particular date/time utility library I am using and there is a workaround. So all sorted and thanks for your replies, much appreciated.

          Comment

          Working...
          X