From: TJ Luoma <tj@luo.ma>
To: Zsh Users <zsh-users@zsh.org>
Subject: can zsh / strftime do "date math"?
Date: Mon, 17 Oct 2011 01:36:36 -0400 [thread overview]
Message-ID: <CADjGqHvM1EqQxLpJTugMr73FLbPPtHF+AVdz=qKZuhtr4shYLA@mail.gmail.com> (raw)
I use the 'gdate' program the from the GNU coreutils to do "date math"
(I don't know if that's the right term or not).
For example, if I wanted to know the time would be in 17 hours, 14
minutes, and 6 seconds, I would use
gdate --date "+ 17 hours 14 minutes 06 seconds"
I can also use the various '%' arguments to format the output, like so
gdate --date "+ 17 hours 14 minutes 06 seconds" '+%Y%m%d'`
I'm wondering if there's any way of doing the same thing with zsh.
TjL
next reply other threads:[~2011-10-17 5:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-17 5:36 TJ Luoma [this message]
2011-10-17 7:15 ` Bart Schaefer
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='CADjGqHvM1EqQxLpJTugMr73FLbPPtHF+AVdz=qKZuhtr4shYLA@mail.gmail.com' \
--to=tj@luo.ma \
--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).