Created
December 20, 2022 06:20
-
-
Save AseemWangoo/a8c4dda4cdfdf5b6f92a125389de902a to your computer and use it in GitHub Desktop.
timezone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dylibPath='/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation'; | |
final lib = TimeZoneLibrary(DynamicLibrary.open(dylibPath)); | |
final timeZone = NSTimeZone.getLocalTimeZone(lib); | |
if (timeZone != null) { | |
print('Timezone name: ${timeZone.name}'); | |
print('Offset: ${timeZone.secondsFromGMT / 60 / 60} hours'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment