Hi,
I has created the shell script in HP_UX 11.23 and using the command, echo $(date +%Y%m%d%H%M%S) > $DIR/alert, placing the time of running the script into a file alert.
I want to compare the time in the above file alert with the current time.If difference is more than 5 min, then print the... (7 Replies)
Hi i've written a script which reads last two line of the log file from N number of servers and send the mail by redirecting to a particular log file.
And the two lines is displayed below.
Oracle Q03 Begin Hot BACKUP Time: 07/23/08 18:35:46
Oracle Q03 End Hot BACKUP Time: 07/24/08 14:18:15... (1 Reply)
I would like to write a shell script that calculated the time difference bettween the log entries. If the time difference is higher as 200 sec. print the complette lines out.
My Problem is, i am unable to jump in the next line and calculate the time difference.
Thank you for your Help.
... (5 Replies)
I have 2 variables
MTIME="Jan_2_2012_23:55:49"
SCH_TIME="Jan_03_2012_00:32:28"
I want to find the time taken (in seconds) between MTIME and SCH_TIME.
Is there any way by which this can be done in Unix Shell Script? (4 Replies)
Hi All :o,
I have some log files which contains these informations:
2013-04-24 09:11:34.018 INFO XXXXXXXXXXXX
2013-04-24 09:11:34.029 INFO YYYYYYYYYYYY
2013-04-24 09:11:34.039 INFO ZZZZZZZZZZZZZZZ
2013-04-24 09:12:21.295 INFO TTTTTTTTTTTTTTT
2013-04-24 09:12:21.489 INFO... (3 Replies)
================================================================================
Request ID GMDCOM TIME GMDRRS TIME COM-RRS
================================================================================
<36812974> Tue Oct 1 13:32:40 2013 Tue Oct 1 20:36:42 2013... (1 Reply)
Request ID GMDCOMTM GMDRRSTIME GMDRESTIME
<36812986> : : :I want to display the date -time difference in other fields. Above I have given for only 1 record. I want to calculate for all the records.
(GMCOMTM - GMDRRSTM) ,(GMDRRSTM-GMDRESTM) and... (5 Replies)
There are 2 dates,
Tue Oct 1 13:40:19 2013
Sun Sept 30 10:26:23 2013
I have multiple dates like the above one. How do I calculate the date time difference and display in another column in Shell script. Please help. (3 Replies)
Hi,
I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log.
Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Discussion started by: Juha
3 Replies
LEARN ABOUT V7
timegm
TIMEGM(3) Linux Programmer's Manual TIMEGM(3)NAME
timegm, timelocal - inverses of gmtime and localtime
SYNOPSIS
#include <time.h>
time_t timelocal(struct tm *tm);
time_t timegm(struct tm *tm);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
timelocal(), timegm():
Since glibc 2.19:
_DEFAULT_SOURCE
Glibc 2.19 and earlier:
_BSD_SOURCE || _SVID_SOURCE
DESCRIPTION
The functions timelocal() and timegm() are the inverses of localtime(3) and gmtime(3). Both functions take a broken-down time and convert
it to calendar time (seconds since the Epoch, 1970-01-01 00:00:00 +0000, UTC). The difference between the two functions is that timelo-
cal() takes the local timezone into account when doing the conversion, while timegm() takes the input value to be Coordinated Universal
Time (UTC).
RETURN VALUE
On success, these functions return the calendar time (seconds since the Epoch), expressed as a value of type time_t. On error, they return
the value (time_t) -1 and set errno to indicate the cause of the error.
ERRORS
EOVERFLOW
The result cannot be represented.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------------------+---------------+--------------------+
|Interface | Attribute | Value |
+----------------------+---------------+--------------------+
|timelocal(), timegm() | Thread safety | MT-Safe env locale |
+----------------------+---------------+--------------------+
CONFORMING TO
These functions are nonstandard GNU extensions that are also present on the BSDs. Avoid their use.
NOTES
The timelocal() function is equivalent to the POSIX standard function mktime(3). There is no reason to ever use it.
SEE ALSO gmtime(3), localtime(3), mktime(3), tzset(3)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU 2016-12-12 TIMEGM(3)