cljs-time icon indicating copy to clipboard operation
cljs-time copied to clipboard

Year from an instant gets mis-parsed: 2018 becomes 118

Open WorldsEndless opened this issue 6 years ago • 1 comments

(timec/year (timec/from-utc-time-zone (js/Date.))) ; =>118

WorldsEndless avatar Mar 01 '18 00:03 WorldsEndless

I think this is because your js/Date is a javascript date, not a goog.date one, and the getYear function for js/Date has this issue.

(-> (js/Date.) (.getYear)) ; => 118 
(-> (timec/now) timec/from-utc-time-zone timec/year) ; => 2018

tomjkidd avatar Mar 08 '18 16:03 tomjkidd