zsh-users
 help / color / mirror / code / Atom feed
* Date prompt expansion
@ 2012-11-26 11:33 Mark van Dijk
  2012-11-26 11:46 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Mark van Dijk @ 2012-11-26 11:33 UTC (permalink / raw)
  To: zsh-users

Following up on my email sent yesterday where I asked a question about
pcre, the question also implied I'm doing stuff with dates.

Currently I am using two different methods of getting the today's
day/month and yesterday's day/month:

1) for today I'm using prompt expansion:
todaysDay=${(%):-%D{"%d"}}   # 26
todaysMonth=${(%):-%D{"%m"}} # 11

2) for yesterday I'm using FreeBSD's date command:
yesterdaysDay=$(/bin/date -v -1d "+%y")
yesterdaysMonth=$(/bin/date -v -1d "+%m")

I'm more fond of the first method. Can the second be done without
calling /bin/date?

Mark


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-26 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-26 11:33 Date prompt expansion Mark van Dijk
2012-11-26 11:46 ` Peter Stephenson
2012-11-26 12:38   ` Mark van Dijk
2012-11-26 13:01     ` Peter Stephenson
2012-11-26 16:15   ` Aaron Schrab

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).