Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is there a way to get the “full” time zone currently in use?



On Sun, Jul 29, 2018 at 08:56:21AM -0400, TJ Luoma wrote:
> That works, and I haven’t found anything else that does. This:
> 
> readlink /etc/localtime | sed ’s#.*/zoneinfo/##g'

There's no need for external commands here.

a=(/etc/localtime(:A))  # Resolve the symlink
print ${a##*/zoneinfo/} # Remove text preceding and including /zoneinfo/

- Matthew Martin



Messages sorted by: Reverse Date, Date, Thread, Author