Operating System - HP-UX
1752587 Members
4488 Online
108788 Solutions
New Discussion юеВ

find time half hour ago from now

 
DeafFrog
Valued Contributor

find time half hour ago from now

Dear Gurus ,

i need to find the time half hour ago from system time , like if system time is 8 past 15 , the the script should give 7 45 , if it 22 30 it should return 22 00.while googling forum i found clay's caljd.sh but could not use it to solve my problem.

Rgeards,
FrogIsDeaf
2 REPLIES 2
DeafFrog
Valued Contributor

Re: find time half hour ago from now

closing the post as i found the solution as :

perl -e '@d=localtime time()-1800; printf "%02d%02d%02d%02d\n", $d[4]+1,$d[3],$d[2],$d[1]'

Regards,
FrogIsDeaf
DeafFrog
Valued Contributor

Re: find time half hour ago from now

solution as stated above ,
regards,
FrogIsDeaf