now() - now(Dates.UTC) does not actually return the correct current local offset, since the two now() invocations happen a few milliseconds apart, and thus do not denote the exact same time. Hence their difference then is not the exact local difference. So unfortunately, as a hack, it does not quite seem to work.
For example, with GMT-1, on a mac: *julia> **now() - now(Dates.UTC)* *3599430 milliseconds* *julia> **Dates.Second(div(Dates.value(now() - now(Dates.UTC)),1000))* *3599 seconds* On Friday, 10 July 2015 17:49:45 UTC+1, Jacob Quinn wrote: > > > On Fri, Jul 10, 2015 at 8:11 AM, Tom Breloff <[email protected] > <javascript:>> wrote: > >> as > > > Tom, > > Yes, the method I proposed won't work retroactively since the method for > getting the current local offset from GMT is `now() - now(Dates.UTC)`. If > you were to run that every second crossing over the daylight savings > moment, you'd see that it correctly adjusts for daylight savings, but it's > only going to give you the *current* offset from GMT. Something more > elaborate will require tapping into the tzinfo database (which TimeZones.jl > will do). > > -Jacob >
