简体   繁体   中英

Dart (Flutter) Wrong Time Zone- GMT is set as GMT 0 although my time zone is GMT +1. How can I change it?

Code: DateTime date = DateTime.now(); print(date.timeZoneName);

Result: I/flutter (18415): GMT

The Result should be GMT +1

Thanks

The timezone used by Dart (and Flutter) when using localtime is coming from the OS on the device the application is running on. So if the timezone does match an expected timezone, please check the timezone settings on your device and verify they match your expectation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM