I have a Linux (bash) script to generate a login message (motd). One of the things it displays is the timezone, using the command timedatectl | grep Time | awk {'print $3'}
.
The command returns something like America/Chicago
which is the format I am seeking.
Naturally, since there is no timedatectl
under FreeBSD, this command does not work and I am seeking an alternative.
The closest I have managed is using date +'%z %Z'
, but that is still quite different.
Is there a way to display the system's timezone in Continent/Region
format under FreeBSD?
Thanks!
/var/db/zoneinfo
exist on the system?/etc/timezone
which is also missing/etc/localtime
exist?cd /usr/share/zoneinfo && find . -type f -exec cmp -s /etc/localtime '{}' \; -print | sed -e 's|^\./||' -e '/posix/d'