• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Illegal instant due to time zone offset transition

    Scheduled Pinned Locked Moved User help
    7 Posts 3 Posters 1.8k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      psysak
      last edited by

      Hey, hopefully this is a quick question. I'm trying to run a Data File CSV importer. I am importing data to a single point and it's all hourly data. When I tried to run the simple imported against my CSV I got this error

       org.joda.time.IllegalInstantException: Cannot parse "11-Mar-18 2": Illegal instant due to time zone offset transition (America/Toronto)
      

      I've googled around and I'm not quite sure I understand what the error is. Is it because 2am does not exist on that day due to time change? Hmm. If that's the case can I just have this thing skip it somehow?

      Jared WiltshireJ 1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ Offline
        Jared Wiltshire @psysak
        last edited by

        @psysak said in Illegal instant due to time zone offset transition:

        Is it because 2am does not exist on that day due to time change?

        Correct. There is no 2am on the 11th. It jumps straight to 3am.

        @psysak said in Illegal instant due to time zone offset transition:

        If that's the case can I just have this thing skip it somehow?

        I dont think so. Can you delete it from the CSV?

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 0
        • phildunlapP Offline
          phildunlap
          last edited by

          You can easily skip it if you can modify the CSV importer, you would just put the call to the DateTimeFormat inside a try / catch instead of letting it get through, i.e.

          long time;
          try {
            time = dtf.parseDateTime(row[0]).getMillis();
          } catch(IllegalInstantException e) {
            return; //Don't let the exception escape
          }
          
          P 1 Reply Last reply Reply Quote 0
          • P Offline
            psysak @phildunlap
            last edited by

            @phildunlap Nice!

            1 Reply Last reply Reply Quote 0
            • P Offline
              psysak
              last edited by

              Interesting, can't compile cause it doesn't seem to understand IllegalInstantException

              1 Reply Last reply Reply Quote 0
              • phildunlapP Offline
                phildunlap
                last edited by

                Did you put

                import org.joda.time.IllegalInstantException;
                

                around the other import statements at the top of the class?

                1 Reply Last reply Reply Quote 0
                • P Offline
                  psysak
                  last edited by psysak

                  ................ yes?....

                  Thank you :)

                  I got around it by putting IllegalArgumentException since Instant extends it, but I will do it properly now

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post