![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| using 'date' to get previous days' dates | slant-40 | UNIX for Dummies Questions & Answers | 2 | 06-17-2008 08:49 PM |
| Script based on input mail | eagercyber | Shell Programming and Scripting | 1 | 05-13-2008 02:39 AM |
| Checking for future / non existent dates | DKNUCKLES | Shell Programming and Scripting | 2 | 10-09-2007 06:20 AM |
| grep a log file to filter previous dates | pinpe | Shell Programming and Scripting | 5 | 08-03-2007 01:25 PM |
| Dates of previous years | terms5 | UNIX for Dummies Questions & Answers | 2 | 03-26-2006 09:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
To get previous or future dates based on input value
Hi,
I need something like, if the input date is 24/Aug/2008 and the inputvalue is +8 then the result should be 1/Sep/2008 (8 days after the input date) if the input date is 24/Aug/2008 and the inputvalue is -8 then the result should be 16/Aug/2008 (8 days before the input date) is there any command in unix,using which i can get this.Please guide me. Thanks. |
|
||||
|
Hi,
Its not helping as I don't have this version. I tried something like this. Code: let noofdays=$1 let totaldays=24*noofdays DATE_STAMP=`TZ=CST-$totaldays date +%d/%b/%Y ` echo "$DATE_STAMP" Its working fine.but when I tried to replace the current date with the given input date I am getting some error. Code: let noofdays=$1 let inputdate=$2 let totaldays=24*noofdays DATE_STAMP=`TZ=CST-$totaldays $inputdate ` echo "$DATE_STAMP" input: ------ $1=2 $2=24/Jan/2008 error: ------ 24/Jan/2008: No such file or directory Why I am getting this error.how I can resolve this?any suggestion please.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|