Shameless plug: 
[https://github.com/treeform/chrono](https://github.com/treeform/chrono)

"+00:00" its an timezone offset, not a timezone or a dst part.

I struggled with timezones for a long time, then one day I said enough is 
enough and wrote my own timezone library. And now I know how they work 100%. I 
have slain one of my big dragons.
    
    
    import chrono
    
    block:
      let
        dtStr = "2019/06/06 18:17:43 +00:00"
        cal = parseCalendar("{year/4}/{month/2}/{day/2} 
{hour/2}:{minute/2}:{second/2} {offsetDir}{offsetHour/2}:{offsetMinute/2}", 
dtStr)
      echo cal
      echo cal.tzName # blank there is no timezone
      echo cal.tzOffset # 0
    
    
    block:
      let
        dtStr = "2019/06/06 18:17:43 -07:00"
        cal = parseCalendar("{year/4}/{month/2}/{day/2} 
{hour/2}:{minute/2}:{second/2} {offsetDir}{offsetHour/2}:{offsetMinute/2}", 
dtStr)
      echo cal #2019-06-06T18:17:43-07:00
      echo cal.tzName # blank there is no timezone
      echo cal.tzOffset # -25200.0 in seconds
    
    
    
    Run

Reply via email to