Re: [SLUG] date ?

From: Paul M Foster (paulf@quillandmouse.com)
Date: Mon Jun 11 2001 - 18:47:07 EDT


On Mon, Jun 11, 2001 at 08:57:27PM +0000, Ron Youvan wrote:

> Hi all:
> IF I run date as date '+%s' it gives me the seconds
> since the beginning of time, (1-1-1970 I think) is
> there a formula or utility that will convert it to
> the date and time?
> I want to automatically create error and log files
> that have unique filenames without my intervention.
> (if I don't rename they get overwritten)
> Getting d=date '+%s' then:
> 2>&1 | tee /hdb/files.iso/$d$1.mklog
> in my script files to work isn't going so well either!
> Any help will be appreciated.
>

I do this in mutt to save traffic into files by date with the following:

date +%Y%m

which gives

200106

for this month.

Make it

date +%Y%m%d

and you'll get

20010611

HTH,

Paul



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:37:10 EDT