GithubHelp home page GithubHelp logo

Comments (5)

jodastephen avatar jodastephen commented on May 24, 2024

Joda-Time DateTimeZone.getDefault() should be the same as TimeZone.getDefault(). If they are not, there is a Joda-Time point to look into. Otherwise, its a question of why the JDK is picking up the wrong time-zone.

If you can, the best approach is probably to debug using breakpoints (bearing in mind I can't reproduce this).

from joda-time.

manogna89t avatar manogna89t commented on May 24, 2024

Thank you for the reply. I will check the TImeZone.getDefault() and will let you know.
If I understand this right, the DateTimeZone.getDefault() will first get the user.timezone and then look for the JDK timezone if it does not find it, correct?

from joda-time.

jodastephen avatar jodastephen commented on May 24, 2024

You can read the code here

from joda-time.

snehil avatar snehil commented on May 24, 2024

I am working with Manogna89t on the same issue, and this is what I have found out:

The system timezone is set to the following:
The system timezone is set to the following: UTC -6:00 Guadalajara, Mexico City, Monterrey

while debugging, the following values are noticed:
DateTimeZone.getDefault()= -06:00]
System.getProperty(user.timezone) -> GMT-06:00]
DateTimeZone.forTimeZone(TimeZone.getDefault())= -06:00

the getDefault() function returns the offset: " -06:00" instead of something like "America/Chicago"

Any thoughts on why the GMT offset would be returned instead of the String "America/Chicago"?

from joda-time.

jodastephen avatar jodastephen commented on May 24, 2024

If you want to have a system/default time-zone of "America/Chicago" then set it using user.timezone of TimeZone.setDefault() or DateTimeZone.setDefault().

from joda-time.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.