Created
December 17, 2023 17:20
-
-
Save dragid10/fb81b30eabcfa7777d35e058b6d519a9 to your computer and use it in GitHub Desktop.
Garmin Developer set 12-hr time
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
On my watch the 12/24 hour setting is in | |
Settings->System->Time->Time-Format | |
You can use it for example like this: | |
var time = Gregorian.info(Time.now(), Time.FORMAT_SHORT); | |
var deviceSettings = System.getDeviceSettings(); | |
var is24Hour = deviceSettings.is24Hour; | |
var hour = is24Hour ? time.hour : 1 + (time.hour + 11) % 12; | |
var pmString = time.hour >= 13 ? "PM" : "AM"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment