question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong default timezone on DateTime.now

See original GitHub issue

DateTime.Now reports the default timezone to be UTC which is not correct.

I’m in Germany so it should be UTC+1 atm.

I suspect this is due to DateTimeZone newDefault = DateTimeZone.forTimeZone(TimeZone.getDefault()); DateTimeZone.setDefault(newDefault);

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
murgocommented, Feb 22, 2016

Doh, the JodaTimeAndroid.init(context); makes all the difference. Too bad I didn’t notice it 3 hours ago. Maybe the library could throw some kind of exception if it hasn’t been initialized?

For me, this issue is fixed now.

0reactions
dlewcommented, Feb 22, 2016

Alright, problem solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When the system time zone changes,python datetime ...
When the system time zone changes,python datetime.datetime.now() still return wrong time! at 2021-01-29T03:51:48, time zone changed.
Read more >
date_default_timezone_set - Manual - PHP
This function returns false if the timezoneId isn't valid, or true otherwise. Examples ¶. Example #1 Getting the default timezone. <?php
Read more >
datetime — Basic date and time types — Python 3.11.1 ...
The timezone class can represent simple timezones with fixed offsets from UTC, such as UTC itself or North American EST and EDT timezones....
Read more >
DateTime — Elixir v1.12.3 - HexDocs
By default, it uses the default time zone database returned by Calendar.get_time_zone_database/0 ... Returns the current datetime in the provided time zone.
Read more >
Converting time zone in Microsoft Power Automate
It's because of services passing dates through in varying formats or time zones. Each connector may use a different datetime format or time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found