we are using hp-ux servers we need to get 2 hours ago datetime value in bash shell script ?
how can i do that any experiences ?
date -d -2hours; date --version
Thu Apr 14 02:38:08 CEST 2011 date (GNU coreutils) 7.4
I'm not a shell script expert, but you may want to check this site at unix.com. They provide this example for subtracting from dates:
# subtract from any date date --date "$dte 3 days 5 hours 10 sec ago" date --date "$dte -3 days -5 hours -10 sec"