![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compare date from db2 table to yesterday's Unix system date | sasaliasim | Shell Programming and Scripting | 8 | 04-24-2008 03:04 AM |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 01:01 PM |
| date subtraction(URGENT) | uday123 | Linux | 3 | 02-25-2008 05:14 AM |
| date issue-find prevoius date in a patricular format | bsandeep_80 | UNIX for Advanced & Expert Users | 3 | 11-15-2007 05:42 PM |
| Date Subtraction in KSH | mharley | Shell Programming and Scripting | 3 | 03-03-2005 08:17 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
subtraction from date
hi gurus!
i realize that my question shows my stupidness, but i need your help! i have: s_date=`date +%m-%d-%Y_%I%p` variable and i need the same, but minus one hour.. what i made: s_date=time(`date +%m-%d-%Y_%I%p`) - 3600 but i'm getting: daily_exports.sh: line 20: syntax error near unexpected token `(' daily_exports.sh: line 20: `new_date=time()-3600' also i did: new_date=time()-3600 s_date=strftime(`date +%m-%d-%Y_%I%p`, new_date); etc.. nothing works, please, help! Thank you beforehand, Maria. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Maria,
Date calculation can be very involved as you have to consider end of month, end of year, leap year, etc. Here is a thread that can help you in this issue: http://www.unix.com/answers-to-frequ...rithmetic.html |
|
#3
|
|||
|
|||
|
Oh, thank you for your help!
this is great source! Thanks, Maria. |
|
#4
|
|||
|
|||
|
still fighting. I'll really appreciate any help.
thank you, M. |
|
#5
|
|||
|
|||
|
cool, i found!
date -d "-1 hour" works pefectly, thank you! |
|||
| Google The UNIX and Linux Forums |