

Date and Time in Java 8: Timezones - rlmw
http://www.insightfullogic.com/blog/2012/dec/19/date-and-time-java-8-2/

======
codeka
This is so long overdue, but I feel like I've been using Joda Time for so long
that the benefit of having it in the platform is kind of outweighed by the
hassle of learning a new API.

~~~
bromley
I doubt there's too much of a learning curve as the new API is pretty similar
to Joda Time: [http://blog.joda.org/2009/11/why-jsr-310-isn-joda-
time_4941....](http://blog.joda.org/2009/11/why-jsr-310-isn-joda-
time_4941.html)

------
aleyan
I wonder how this library deals with ambiguous times around daylight savings.
For example on the day of switching from summertime to wintertime the clock
goes from 2:59 am to 2:00 am again resulting in the hour being repeated. If
you know the correct time zone for that timestamp, it is still ambiguous which
of the two UTC times it maps to.

~~~
pkulak
I've always wondered how the world in general can tolerate something like
that. Here we are adding leap _seconds_ every year or so, and yet we're all
totally fine with the same, indistinguishable hour repeating once a year.

------
bnr
What's the use case for storing a time with timezone instead of just storing
the UTC value?

~~~
0x0
Maybe if you want to schedule a meeting for 4pm local time, no matter the time
zone. Some countries have very unpredictable daylight saving schedules.

(For example, <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=551195> \- "To
keep on with the great work our government has done the past two years of
deciding stuff with 2 or 3 days of anticipation, the government has just
decided that we won't switch to DST this Sunday.")

~~~
JonnieCache
For the curious, the government in question was argentina.

~~~
thisone
Australia also has some interesting history with daylight savings. I remember
it being used for a discussion of DateTimeOffset in .net because it could
showcase all the different scenarios.

------
RyanZAG
The real solution is to get timezones thrown out. All they do is waste the
time of everyone involved and create complicated issues around travel,
finance, computing, etc.

They have no real benefit - if you want to come into work later in winter
because it's dark where you live then just come in later! Changing time to
suite this madness is insane, broken, and requires immediate fixes.

If we could get all the OS markets/net service providers to agree to a
boycott, then nobody would even notice DST is gone as they just get their time
from their phone/computer/radio/etc anyway.

I'll get the pitchforks and we can get this started. Anybody with me?! :)

~~~
TazeTSchnitzel
No.

What we really need is timezones that are always straight hour offsets of UTC,
and no DST. With that simplified, we'd keep the benefits of timezones but have
less problems dealing with them.

~~~
RyanZAG
Sorry, I completely messed up my post. Replace every 'timezone' in the post
with 'day light savings' - it will also make a lot more sense then.

------
bjhoops1
I cringe every time I hear "Date" and "Java" in the same sentence.

~~~
RyanZAG
Then you're cringing for the wrong reasons - nearly every deployed language
gets this wrong also (numeric timezones instead of descriptive ones) - java is
actually one of the first to fix this stuff up.

~~~
autarch
Perl has had the DateTime suite of modules since early 2003. (Shameless plug
since I'm the author). <https://metacpan.org/release/DateTime>

~~~
joesb
So does Java. But, same as in Perl, it was not included in standard library.

