![]() |
|
|
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 |
| Help, I need to get the last date of previous month | sirrtuan | Shell Programming and Scripting | 11 | 10-14-2008 06:59 AM |
| yesterday date month/date | skully | Shell Programming and Scripting | 5 | 06-24-2008 06:51 AM |
| last month end date | vanathi | UNIX for Advanced & Expert Users | 7 | 03-21-2008 04:17 PM |
| find out month from a date | rudoraj | UNIX for Dummies Questions & Answers | 5 | 07-03-2007 09:21 AM |
| how to get month last date in unix | rajan_ka1 | Shell Programming and Scripting | 12 | 10-04-2005 08:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Get date one month from today
I need to get the date one month in the future from today - or 30 days from today etc...
I need this to work all year around - I cannot find anything to solve this issue in the search / faqs etc.... |
|
||||
|
Its okay - just found I can use something like the below
curmth=`date +%m` set -A mth 01 02 03 04 05 06 07 08 09 10 11 12 nextmth=${mth[$((curmth))]} echo $nextmth curday=`date +%d` curyear=`date +%Y` todaynextmonth=$curyear$nextmth$curday echo "todaynextmonth is $todaynextmonth" Last edited by frustrated1; 08-15-2008 at 06:16 AM.. |
|
||||
|
Your script doesn't work in December.
Did you actually look in the FAQ section? Yesterdays Date/Date Arithmetic |
|
||||
|
Quote:
date --date='1 month' date --date='10 days ago' /Lakris |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|