microsoft / microsoft/react-native-windows

Date.now() gives different result depending on DEBUG or RELEASE mode...

Open
#12,289 9 comments 0 reactions 1 assignee View on GitHub

@vmoroz is already working on this.

Since Oct 30, 2023.

Area: JavaScript Engine bug Workstream: ES Compliance SFI
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

In my production app, rnw apps show different Timestamps generated with Date.now() or new Date() print differnet timestamps. In Debug mode, the timestamp is accurate. In Release mode, the timestamp is off by 2 hours.

AS useColorScheme with Debugger always returns white, the text isnt really readable.

Light Theme: Debug Build
Dark Theme: Release Build

DEBUG
RELEASE

Steps To Reproduce
  1. Create new app.
  2. print Date.now()
  3. Build in Release
  4. Build in Debug
  5. See the difference.
Expected Results

Same timecode, independent of build mode.

CLI version

11.3.7

Environment
info Fetching system and libraries information...
System:
  OS: Windows 10 10.0.22000
  CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
  Memory: 6.42 GB / 15.97 GB
Binaries:
  Node:
    version: 18.15.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.5.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.5.33516.290 (Visual Studio Community 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: ^18.2.0
  react-native:
    installed: 0.72.6
    wanted: ^0.72.4
  react-native-windows:
    installed: 0.72.16
    wanted: ^0.72.16
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.