Issue
Emulator timezone is the same as system timezone, but Flutter's DateTime.now()
is returning GMT time.
The greeting in the below code should've been 'Good afternoon'. Local time is 15:23
.
Details:
Flutter/Dart:
flutter --version
Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4d7946a68d (12 days ago) • 2021-03-18 17:24:33 -0700
Engine • revision 3459eb2436
Tools • Dart 2.12.2
Emulator:
Nexus 5X on Android 7.0 (Nougat) - API 24
Emulator version: 30.5.3-7196367
System:
Microsoft Windows 10 Pro 10.0.15063 Build 15063
VS Code:
Version: 1.54.3 (user setup)
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.15063
Solution
It seems the bug is particular to the Nexus 5X Android 7.0 Nougat
emulator, and the code runs fine on Pixel 3a Android 11
emulator.
Here is the same code on both emulators side-by-side. Local time is 16:37
, GMT time is 11:07
at the time of this screenshot. Both emulators are already set to the same timezone as the system.
Answered By - SNag
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.