hello gurus,
i want a perl/shell script which once invoked should convert a set of EPOCH timestamps to local time ( IST..i want) .
how does it work ,i have an idea on that..but writing a perl/shell script for it is not possible for me...so i need help for the same.
my exact requirement is... (2 Replies)
Hi all,
I'm after some help with this small issue which i'm struggling to work out a fix for.
I have a file that contains records that all have a time stamp for each individual record, i need to search the file for a specific time stamp and then search back 10 seconds to see if the number... (2 Replies)
I am trying get time difference of two dates in secs. Initially I want to convert a standard date format to epoch for two dates and then subtract the two epoch dates.
Example :
date -d "2007-09-01 17:30:40" '+%s'
But this gives me below error
date: illegal option -- d
Usage: date
OS: AIX... (6 Replies)
Hello Expert,
I need to transpose Date-Timestamp based on same column values and calculate time difference. The input file would be as below and required output is mentioned in the bottom
INPUT File
========
08/23/2012 12:36:09 JOB_5340
08/23/2012 12:36:14 JOB_5340
08/23/2012... (2 Replies)
Hello All,
I have a Perl script I'm writing where I ask the user to enter a "start time" for something. The "$start_time" will be in the format of:
# The Time CLI Option Can be in the format of:
--start-time="1day"
--start-time="2hours"
--start-time="45min"
... (1 Reply)
I have a requirement to find long running instances for notifying the stake holders based on the triggered time in AIX.
I am not sure how to convert the triggered time to epoch seconds.
For example :
Current triggered time of instance is 13:06:19 -> how to convert this into epoch in the... (5 Replies)
Hi All,
Firstly thank you for the forum members I need to find time difference b'w two rows of timestamp using awk/shell.
Here is the logfile:
cat business_file
start:skdjh:22:06:2010:10:30:22
sdfnskjoeirg
wregn'wergnoeirnfqoeitgherg
end:siifneworigo:22:06:2010:10:45:34... (3 Replies)
Hi All,
I have scenario where i have to compare two dates.
I thought of converting them to epoch seconds and do a numeric comparison.
This works fine on Linux systems.
$ date -d '2015/12/31' +%s
1451538000
$ date +%s
1449159121
But we don't have -d option in HPUX.
What would be... (5 Replies)
Discussion started by: veeresh_15
5 Replies
LEARN ABOUT CENTOS
timelocal
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(): _BSD_SOURCE || _SVID_SOURCE
DESCRIPTION
The functions timelocal() and timegm() are the inverses of localtime(3) and gmtime(3).
CONFORMING TO
These functions are nonstandard GNU extensions that are also present on the BSDs. Avoid their use; see NOTES.
NOTES
The timelocal() function is equivalent to the POSIX standard function mktime(3). There is no reason to ever use it.
For a portable version of timegm(), set the TZ environment variable to UTC, call mktime(3) and restore the value of TZ. Something like
#include <time.h>
#include <stdlib.h>
time_t
my_timegm(struct tm *tm)
{
time_t ret;
char *tz;
tz = getenv("TZ");
if (tz)
tz = strdup(tz);
setenv("TZ", "", 1);
tzset();
ret = mktime(tm);
if (tz) {
setenv("TZ", tz, 1);
free(tz);
} else
unsetenv("TZ");
tzset();
return ret;
}
SEE ALSO gmtime(3), localtime(3), mktime(3), tzset(3)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2013-07-04 TIMEGM(3)