NativeScript / NativeScript/android

Local timezone not taken into account in API Level 24

Open
#1,255 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity: high
Dominant language
C++
Stars
563
Forks
144
Avg merge
10h 46m
Merged PRs (30d)
14

Description

Environment

  • CLI: 5.1.0
  • Cross-platform modules: 5.1.0
  • Android Runtime: 4.2.0 (and higher)

Describe the bug

The local timezone is not properly taken into account when creating dates (GMT is always assumed).

To Reproduce

  1. Create a x86 Android emulator using API Level 24
  2. Set to some custom timezone in the device Settings.

Expected behavior

The timezone is properly taken into account when using console.log(new Date());:

Thu Jan 24 2019 09:40:47 GMT+0200 (EET)

Actual Behavior

The date is assumed in GMT:

Thu Jan 24 2019 07:40:47 GMT+0000 (GMT)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with an x86 Android emulator on API Level 24, set a custom timezone, and run console.log(new Date()). Compare the result with the expected local offset and the GMT output described here. Done means date creation respects the device timezone on API Level 24 and higher.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cpp
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.