how to set next 5 days

Zitian Guo ZGuo at
Tue Sep 5 22:24:00 CST 2006

Hi Chris,

Thank you very much for help.

I want to 

date -d '060905 - 4 hours' +%y%m%d%h

But this does not work.

Do you know how to do this?



-----Original Message-----
From: Chris Foote [mailto:chris at] 
Sent: Wednesday, August 23, 2006 2:26 AM
To: Zitian Guo
Cc: LinuxSA
Subject: Re: how to set next 5 days

On Mon, 21 Aug 2006, Zitian Guo wrote:

> In order to do weather forecast every day, I need to set up beginning and
> time in the script.  I can use "data -u %Y%m%d" to set the time for to day,
> how can I set the time for the next 5 day?

Do you really want to set the time or just read it ?

To view the current UTC date:
 	date -u +%Y%m%d
To view the current UTC date in 5 days time:
 	date -u +%Y%m%d --date="5 days"

If you wanted localtime instead of UTC, remove the -u switch.


Chris Foote <chris at>
Inetd Pty Ltd T/A HostExpress
Phone: (08) 8410 4566
This message (including any attachments) is a confidential and privileged communication of
AWS Convergence Technologies, Inc. and intended only for the addressee. Any unauthorized use,
distribution or copying of this message (or any attachment) is prohibited. If you are not the
addressee or a person authorized to receive messages for the addressee, you have received this
message in error. In that case, please delete this message and call us at 301-250-4000 so that we
can correct our records in order to avoid this mistake in the future. Thank you.

More information about the linuxsa mailing list