![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calculate the date of next satureday of current date. | rinku | Shell Programming and Scripting | 3 | 09-02-2008 08:05 PM |
| Using awk and current date command | wereyou | Shell Programming and Scripting | 2 | 06-06-2008 04:25 PM |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 12:01 PM |
| Processing a log file based on date/time input and the date/time on the log file | primp | Shell Programming and Scripting | 4 | 03-16-2008 07:23 AM |
| File date vs Current date | trexlim | Shell Programming and Scripting | 4 | 05-04-2007 06:35 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
I need to get the date and time for past 1 hour from the current date. Anyone know how to do so? Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
Another nce way is setting up a new variable (you can adjust the number of hours by changng the +n value previous day is +24)
Code:
-bash-3.00$ NEWDATE=`TZ=GMT+2 date +%Y-%m-%d" "%H:%M:%S` -bash-3.00$ echo $NEWDATE 2007-12-21 09:57:09 -bash-3.00$ date Fri Dec 21 11:57:17 GMT 2007 -bash-3.00$ |
| Thread Tools | |
| Display Modes | |
|
|