Hello,

I am tried to do this:

  * Parse the timezone from an arbitrary but valid date/time string
  * Convert a `Time` variable representing time in the local time zone to the 
time zone parsed above using `inZone`.



I tried doing the first part using below:
    
    
    import times
    let
      dtStr = "2019/06/06 18:17:43 +00:00"
      dt = parse(dtStr, "YYYY/MM/dd HH:mm:ss zzz")
    echo dt
    echo dt.timezone
    echo dt.utcOffset
    
    
    Run

But it prints:
    
    
    2019-06-06T14:17:43-04:00
    LOCAL
    14400
    
    
    Run

I understand why that happens.. because as mentioned in 
[https://nim-lang.github.io/Nim/times#parse%2Cstring%2CTimeFormat%2CTimezone%2CDateTimeLocale](https://nim-lang.github.io/Nim/times#parse%2Cstring%2CTimeFormat%2CTimezone%2CDateTimeLocale)
 :

> If a UTC offset was parsed, the result will be converted to the zone timezone.

But then the original time zone (which was UTC: +00:00) is lost!

How do I parse that original time zone to a `TimeZone` variable from 
`"2019/06/06 18:17:43 +00:00"`?

Thanks.

Reply via email to