• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Java TimeZone: How to get current date and daylight saving behaviour

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a country e.g. "Canada" and I know its offset i.e. GMT-8:00.

My questions are:

1. How can I get the current date in Canada using Java TimeZone or any other method?

2. How can I know whether at this moment (at current datetime) daylight saving behaviour is being observed in Canada or not. (Basically if I get Country to Daylight Saving Rules mapping using a java method, that will solve this problem.)

Is there any example for reference?

Thanks a lot for your help.

Regards,
Vikas
 
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not an advanced question, and a duplicate to boot.

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
 
I brought this back from the farm where they grow the tiny ads:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic