andrewmcveigh / cljs-time

A clj-time inspired date library for clojurescript.
342 stars 57 forks source link

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

Open WorldsEndless opened 6 years ago

WorldsEndless commented 6 years ago

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

tomjkidd commented 6 years ago

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