From: Stephen Samuel <samuel@bcgreen.com>
To: "Mr. James W. Laferriere" <babydr@baby-dragons.com>
Cc: "César Soler" <csoler@euskalnet.net>, linux-admin@vger.kernel.org
Subject: Re: test the file date
Date: Tue, 10 Jun 2003 16:03:30 -0700 [thread overview]
Message-ID: <3EE663C2.9020505@bcgreen.com> (raw)
In-Reply-To: <Pine.LNX.4.56.0306101710130.10540@filesrv1.baby-dragons.com>
Mr. James W. Laferriere wrote:
> On Tue, 10 Jun 2003, Stephen Samuel wrote:
>>Note that it takes a bit more magic to properly come up with
>>a date string for yesterday... I can think of a perl script
>>that could do it:
>>-----------------------
>>#!/usr/bin/perl
>>die "Usage: $0 number_of_days_ago\n"
>>$days_ago=$ARGV[0];
>>( $sec, $min,$hour,$mday,$mon,$year ) = localtime(time-$days_ago*3600*24);
>>printf "%02d%02d%02d\n", $year % 100 , $mon+1, $mday;
>>-----------------------
>
> Try using gdate(date) like so .
> date "+%y%m%d" --date="1 days ago"
Yay! they've modularized the date-pareing functions of 'at'!
--
Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
http://www.bcgreen.com/~samuel/
Powerful committed communication, reaching through fear, uncertainty and
doubt to touch the jewel within each person and bring it to life.
prev parent reply other threads:[~2003-06-10 23:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-10 9:50 test the file date César Soler
2003-06-10 9:49 ` Joakim Ryden
2003-06-10 10:10 ` Re[2]: " César Soler
2003-06-10 15:23 ` Glynn Clements
2003-06-10 21:03 ` Stephen Samuel
2003-06-10 21:11 ` Mr. James W. Laferriere
2003-06-10 23:03 ` Stephen Samuel [this message]
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=3EE663C2.9020505@bcgreen.com \
--to=samuel@bcgreen.com \
--cc=babydr@baby-dragons.com \
--cc=csoler@euskalnet.net \
--cc=linux-admin@vger.kernel.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.
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).