Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12hr Display Mode #39

Closed
NexGen-3D-Printing opened this issue Feb 6, 2024 · 2 comments
Closed

12hr Display Mode #39

NexGen-3D-Printing opened this issue Feb 6, 2024 · 2 comments

Comments

@NexGen-3D-Printing
Copy link

First up, a quick thanks, this clock is 99% perfect, just the 12/24hr thing was bugging me and I seen nothing in the documentation on changing it, so I decided to mess about and figured it out.

Just in case anyone else is wondering, as every single clock I looked at for Home Assistant was using 24hr mode, the following will give you 12hr mode as wifes and kids dont understand 24hr clocks properly:

type: custom:digital-clock
timeFormat: h:mm a
dateFormat:
weekday: long
day: 2-digit
month: short

This will display your clock like this:

Clock

@kvoth1
Copy link

kvoth1 commented Feb 6, 2024

How do I set to 24 hour? It’s defaulting to 12 hour when using the sample code for me when I always use 24 hour. :)

Edit: figured it out
timeformat: HH:mm

@wassy92x
Copy link
Owner

wassy92x commented Feb 7, 2024

Firstly the displayed format is dependent on the locale. For example we in Germany (locale de) always dispay the time in 24hours format and for example in England (locale en) the default for a time is the 12h format. To set the locale either set the locale property in the card or set the correct locale in your home assistant profile. Another possibility is to set the format explicitly. In your case the property timeFormat has to be set to HH:mm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants