From: Linus Arver <linusarver@gmail.com>
To: luomat@gmail.com
Cc: zsh-users@zsh.org
Subject: Re: Is there a way to get the “full” time zone currently in use?
Date: Fri, 27 Jul 2018 16:09:03 -0700 [thread overview]
Message-ID: <CAMo6p=HNc+2yWegoKG+ACJ3T9D07HhQ0V=tX8Jsi5NsaXyKpYg@mail.gmail.com> (raw)
In-Reply-To: <CADjGqHvLPFsBRUpCFSKk=rLLyG6mBwpv4HKhJeg7N02iiv4-Yg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 986 bytes --]
How about
readlink /etc/localtime
?
On Fri, Jul 27, 2018 at 9:13 AM TJ Luoma <luomat@gmail.com> wrote:
> Hello Zsh Friends,
>
> I am trying to use zsh to find the current time-zone that the computer
> uses.
>
> I know that this:
>
> `strftime "%Z" "$EPOCHSECONDS"`
>
> will show me the current timezone (EDT, in my case) but I'm looking for
> "America/New_York"
>
> The only way that I can find to get that information on the Mac is
>
> `sudo systemsetup -gettimezone`
>
> but it seems absurd to need to use `sudo` to get that information.
>
> I searched the web and found that the variable "TZ" is supposed to hold
> this command, but TZ is empty in my testing on my Macs, so that's no help
> either.
>
> I've got to imagine that there's _some_ way to do this, but I'm stuck
> trying to figure it out.
>
> Anyone have a solution?
>
> Thanks for your time
>
> Tj
>
>
> --
> TJ Luoma
> TJ @ MacStories
> Personal Website: luo.ma (aka RhymesWithDiploma.com)
> Twitter: @tjluoma
>
next prev parent reply other threads:[~2018-07-27 23:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 16:12 TJ Luoma
2018-07-27 23:09 ` Linus Arver [this message]
2018-07-29 12:56 ` TJ Luoma
2018-07-29 15:32 ` Matthew Martin
2018-07-31 13:54 ` TJ Luoma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMo6p=HNc+2yWegoKG+ACJ3T9D07HhQ0V=tX8Jsi5NsaXyKpYg@mail.gmail.com' \
--to=linusarver@gmail.com \
--cc=luomat@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).