Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need to get 4 Hrs back time and compare with successive time Post 302214960 by maanik85 on Tuesday 15th of July 2008 08:25:29 AM
Old 07-15-2008
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
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Rolling back time

Hi all, Have a small problem. Back in October the pervious sys-admin (of a client's company) made the necessary adjustments to the system clock for daylight savings (Sydney time - +11 GMT). As far as I can gather, they just amended the time - NO TIMEZONE !?! Is there an effective and safe... (5 Replies)
Discussion started by: Cameron
5 Replies

2. SuSE

Time resetting to 00 HRS on starting

I Have a SUSE Linux Enterprise server 9.0. When I start the server , using date command I daily find that the time it is showing is 00.00 Hrs. It shows the date correctly. Every day I have to set the time using the date command. I am facing this proble from last 3 weeks but couldn't find a... (4 Replies)
Discussion started by: V.V.KUMAR
4 Replies

3. Shell Programming and Scripting

Compare Last Modified Time across Time Zone

Hi, I'm new to shell script programming, I only have Java programming background. I'm writing a shell script to do file synchronization between 2 machines that located at different time zone area. Both machine were set its time zone according to its geographical location (Eg: server is at... (1 Reply)
Discussion started by: python
1 Replies

4. What is on Your Mind?

Well it took a bit of time but I am back on the road again...

I have not been very active on here for a while and when I have it was with CygWin... Well this MBP had to go back to the Apple Store for a new disk drive. It was repaired under warranty and I was very pleased with the service. However, returning this tub back to not quite the same as it was... (0 Replies)
Discussion started by: wisecracker
0 Replies
ZDUMP(8)						    BSD System Manager's Manual 						  ZDUMP(8)

NAME
zdump -- time zone dumper SYNOPSIS
zdump [--version] [-v] [-c [loyear,]highyear] [zonename ...] DESCRIPTION
zdump prints the current time in each zonename named on the command line. These options are available: --version Output version information and exit. -v For each zonename on the command line, print the time at the lowest possible time value, the time one day after the lowest possi- ble time value, the times both one second before and exactly at each detected time discontinuity, the time at one day less than the highest possible time value, and the time at the highest possible time value, Each line ends with isdst=1 if the given time is Daylight Saving Time or isdst=0 otherwise. -c [loyear,]highyear Cut off the verbose output near the start of the given year(s). By default, the program cuts off verbose output near the starts of the years -500 and 2500. LIMITATIONS
The -v option may not be used on systems with floating-point time_t values that are neither float nor double. Time discontinuities are found by sampling the results returned by localtime at twelve-hour intervals. This works in all real-world cases; one can construct artificial time zones for which this fails. SEE ALSO
ctime(3), tzfile(5), zic(8) BSD
October 29, 2003 BSD
All times are GMT -4. The time now is 04:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy