Changed time-zone from default to:
set system time-zone Europe/Stockholm
However when doing “show date” the output is:
Mon Jul 10 06:36:50 PM CEST 2023
Expected output is:
Mon 10 jul 2023 18:36:50 CEST
That is expected is 24h time instead of 12h time.
Compare output of “locale” between Ubuntu and VyOS 1.4 rolling (230710):
VyOS 1.4 rolling (230710):
I guess LC_TIME is involved in this.
I think the output is the expected one. You are just changing the timezone and not the locality used to modify output. There is no way to modify the locality at the moment as far as I know.
Hi @Apachez ,
I have checked Time Zone setting on:
- VyOS 1.4-rolling-202307060317
No problem found.
vyos@vyos# set system time-zone Europe/Stockholm
vyos@vyos:~$ show date
Tue Jul 11 07:31:21 AM CEST 2023
A system time zone must be specified, this can be done by either specifying the zone as Region/Location or as offset from UTC, the system’s default zone is GMT. When the Region/Location format is being used, daylight savings time (DST) adjustments are done automatically.
Again, your “show date” shows a 12h clock instead of the 24h which whole Europe is using.
24h is the proper way to display the digital time in Europe.
@Apachez many Linux based operation systems locale settings are currently set to a locale that specifies a 12-hour time format.
With typing locale we can view the current locale settings. Basically, all the locale settings are just environment variables, but there are some dependencies between them.
If we are using the default en_US.UTF-8 locale, then en_GB.UTF-8 would be the closest equivalent with 24-hour time representation. To set it, use:
localectl set-locale LC_TIME=en_GB.UTF-8
Then logout & log back in to have the change take effect in your session.
If you are unsure, you can test the output by specifying the desired locale as an environment variable for the date command:
Tue Jul 11 04:46:10 PM +04 2023
Tue 11 Jul 16:46:14 +04 2023
I know how to set things in a linux box - done that for decades.
Problem here is that VyOS doesnt honor the selected timezone. As in when Europe/x is set then a 24h clock should be used instead of a 12h AM/PM clock.
Or if the VyOS team dont want to alter things in the background when a timezone is selected then the time-locate should have its own parameter to be set in config mode.
set system time-format 12h
set system time-format 24h
Default should be 24h due to ISO-standards. Would also match how many other routers/switches/firewalls out there by default displays current time.
One should NOT be forced to do things in the linux shell to make VyOS behave properly IMHO.