This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

ZonedDateTime for daylight savings

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy,
can someone please explain why this code behave differently for US and EU? Does Java thinks Europe doesn't follow daylight savings time?



I get:


2016-03-13T01:30-05:00[US/Eastern]
2016-03-13T01:30+01:00[Europe/Berlin]
2016-03-13T03:30-04:00[US/Eastern]
2016-03-13T02:30+01:00[Europe/Berlin]

2016-11-06T01:30-04:00[US/Eastern]
2016-11-06T01:30+01:00[Europe/Berlin]
2016-11-06T01:30-05:00[US/Eastern]
2016-11-06T02:30+01:00[Europe/Berlin]
2016-11-06T02:30-05:00[US/Eastern]
2016-11-06T03:30+01:00[Europe/Berlin]


 
Marshal
Posts: 67464
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing the date. Summer time didn't start here until 27th March in 2016.
By the way, zoneEU is not an accurate name because the EU covers at least three timezones (GMT in Portugal and Ireland, CET=GMT+01:00 in France and Germany, and I think EET=GMT+02:00 in Romania etc).
 
lux Green
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't want to be rude, but I think you did not understand a question.
Question is about that day when clocks go either 1 hour early or 1 hour later. It happens in whole world at a same date. 2016 was 13.March and 6.November, respectively.
I left that variable name because I tried changing different EU zones, but with same result...
 
Saloon Keeper
Posts: 21603
147
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

lux Green wrote:I don't want to be rude, but I think you did not understand a question.
Question is about that day when clocks go either 1 hour early or 1 hour later. It happens in whole world at a same date. 2016 was 13.March and 6.November, respectively.
I left that variable name because I tried changing different EU zones, but with same result...



Whatever in the world gave you that idea?
 
Rancher
Posts: 4450
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

lux Green wrote:I don't want to be rude, but I think you did not understand a question.
Question is about that day when clocks go either 1 hour early or 1 hour later. It happens in whole world at a same date. 2016 was 13.March and 6.November, respectively.
I left that variable name because I tried changing different EU zones, but with same result...



Most northern hemisphere countries that use DST change over on the last Sunday of March and back on the last Sunday of October, so the 27th and 30th respectivley for 2016.

See here:
https://www.timeanddate.com/time/dst/2016.html
 
Tim Holloway
Saloon Keeper
Posts: 21603
147
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These are the dates when DST/Summer Time go into effect next:

https://www.timeanddate.com/time/dst/events.html

Note that Fiji actually switched about a month ago.

So no, DST does not change at the same time either world-wide or even hemisphere-wide.

And here is information on the TZDATA database, which includes changeover rules:

https://en.wikipedia.org/wiki/Tz_database
 
lux Green
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pff I am blown away with this. thanks for clarification.
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!