Skip to content

Commit

Permalink
Added linux-friendly comment to yesterdate
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrady committed Mar 25, 2009
1 parent 3e11b02 commit 1c09929
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions yesterdate
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
# month as a 2-character space-padded field without a leading zero,
# e.g. "Thu Dec 04 10:28:39 MST 2008". This format can't be
# constructed out of existing ruby date codes.
#
# Note that on linux, you can do this directly with:
#
# date -d yesterday %c
#
# ...but not on OSX. Meh.
fmt = ARGV[0] || "%c"
puts (Time.now - 86400).strftime(fmt)

0 comments on commit 1c09929

Please sign in to comment.