DateTimeZone conversion - NullPointerException

107 views
Skip to first unread message

Pavan Reddy

unread,
Mar 5, 2015, 4:21:10 AM3/5/15
to clj-...@googlegroups.com
Hello,
I get a NullPointerException when I try to convert a timezone using clj-time.core/time-zone-for-id but it works fine when I try clj-time.core/time-zone-for-offset .

I am sure that "US/Pacific" or "America/Los_Angeles" are valid arguments because I should have received a IllegalArgumentException otherwise.

user=> (clj-time.core/to-time-zone (clj-time.local/to-local-date-time "2015-02-25T23:17:03.150Z") (clj-time.core/time-zone-for-id "US/Pacific"))
;;Same for America/Los_Angeles
;NullPointerException   org.joda.time.tz.CachedDateTimeZone.getInfo (CachedDateTimeZone.java:143)
 
user=> (clj-time.core/to-time-zone (clj-time.local/to-local-date-time "2015-02-25T23:17:03.150Z") (clj-time.core/time-zone-for-offset -7))

;#<DateTime 2015-02-25T16:17:03.150-07:00>
Thanks.

Pavan Reddy

unread,
Dec 11, 2015, 6:15:04 PM12/11/15
to clj-time
Just tested this, works fine with clj-time 0.11.0
Reply all
Reply to author
Forward
0 new messages