On Jun 10, 2015, at 3:58 AM, Jason Marmon <
jtma...@gmail.com> wrote:
> Is there a simple way using clj-time to account for daylight savings?
>
> If I do (t/hour (t/to-time-zone (t/now) (t/time-zone-for-offset -5))) the time is off by one. Is the idiomatic way just to check the date and if it's within the daylight savings range, adjust the time? Seems like something clj-time might handle.
I don’t see that:
; CIDER 0.8.1 (Java 1.8.0_31, Clojure 1.7.0, nREPL 0.2.6)
user> (require '[clj-time.core :as t])
nil
user> (t/hour (t/to-time-zone (t/now) (t/time-zone-for-offset -5)))
13
user> (t/hour (t/to-time-zone (t/now) (t/time-zone-for-offset -7)))
11
user>
Right now it’s 11:10 here in San Francisco and the West Coast timezone is -7 hours from GMT — see
http://www.timeanddate.com/worldclock/usa/san-francisco for that.
Sean Corfield -- (904) 302-SEAN
An Architect's View --
http://corfield.org/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)