The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-15-2008
maanik85 maanik85 is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 2
Need to get 4 Hrs back time and compare with successive time

Hi all,

I am working on a script in which i need to get 4 hrs back time from the current time which i got from this perl function :

`perl -e 'print localtime(time() - 14400) . "\n"'`

now i need to get this in a loop and increment that time by 15 minutes
i.e
i=900(=15minutes)
`perl -e 'print localtime(time() - 14400+$i) . "\n"'`
I do not know perl much and the above code does not work . i have to compare time from a table column from a database which has a listing afer every 15 minutes . so basically i hv to get a loop in which i can use this function and compare the time which is exactly after every 15 minutes. there is a new lisitng in the Db after every 15 minutes and i need to check the time gap.

How can I compare time from this perl function or if there is any other script it will be really appreciated .

Thanks,
Manik