iOS Question How to convert from DATETIMEOFFSET to Ticks

Discussion in 'iOS Questions' started by stingrae, Jul 3, 2018.

  1. stingrae

    stingrae Member Licensed User

    Hi,

    My SQL Server DB returns dates as per the following JSON:

    Code:
    {
      
    "OrderID"19,
      
    "OrderModifyTS""2018-07-03T20:59:30+09:30"
      
    "OrderRequestedTS""2018-07-03T20:59:28+09:30",
      
    "OrderEstimatedTS""2018-07-03T21:09:30+09:30"
    }
    But when I try the following B4i code, it crashes:

    Code:
    DateTime.DateFormat = "yyyy-MM-ddTHH:mm:ssz"
      
    Dim t As Int = DateTime.DateParse(MapOrders.Get("OrderRequestedTS"))
      
    Log(t)
    I've searched here and tried different formats, but without luck.

    Any advice?

    Cheers.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    stingrae likes this.
  3. stingrae

    stingrae Member Licensed User

    Sorry ... Will do from now on.

    And Thanks :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice