Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi i want to reduce one day from the current date how to do

Status
Not open for further replies.

CALYAN

Programmer
Apr 23, 2001
39
US
The ';' can be omited :

FILENAME=$(TZ=TZ+23 date +%b%d).gr
print $FILENAME
Jean Pierre.



Thank aigles for this valuable post!


Inappropriate post?
If so, Red Flag it!


Check out the FAQ
area for this forum!



CALYAN (Programmer) Jan 14, 2004
Hi it shows only current date Jan14.gz I want to reduce
one day from it. how to do?

 
You can use the date command. Here is the cut and paste from the man for date:
date [-u] [mmddhhmm[[cc]yy]]

Set the HP-UX system clock to the date and time
specified. You require the superuser privilege
If you include the -u option, the specified date and time
is assumed to be in Coordinated Universal Time (UTC).

The numeric argument is interpreted left to right in
two-digit pairs as follows:

mm Month number [01-12].
dd Day number in the month [01-31].
hh Hour number (24-hour system) [00-23].
mm Minute number [00-59].
cc Century minus one [19-20].
yy Last two digits of the year number
If omitted, the current year is used.

If you attempt to set the date backwards, date generates
the warning,

do you really want to run time backwards?[yes/no]

Type yes or the equivalent for your locale to set the
clock backwards; anything else to cancel the command.

Here is an example of the command:
date -u 011610222004
This sets the date/time to 01/16/2004 10:22 AM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top