BTW if you're doing a bit of date calculations a good trick is to convert your dates to seconds past epoch they you can add/subtract seconds as you like using shell, or even find the difference between two dates.
From date to epoch time date -d Jan-10-2011 +%s
From epoch time to date date -d @1294581600 +%b-%d-%Y
Guys, please help.
I make all my test under ubuntu and redhat 5 and all working fine.
The problem is that my script should run under SunOS where the bash version is:
GNU Bash-2.05
SunOS version is
SunOS rmcs 5.9 Generic_118558-09 sun4u sparc SUNW,Sun-Fire-V440
So the previous commands doesn't works. It show me the HHMM but it doesn't substract any time!!!
root@rms /# timetmp=$(date +%H%M --date "$dte -1 minute")
root@rms /# echo $timetmp
1307
root@rms /# date
Thu Jan 20 13:07:31 CET 2011
If you have a C compiler available on solaris I've written a little C program that prints a time with secs adjustment (positive or negative) you can also specify the output format but it defaults to %d/%b/%Y %T