If you want to know the delta between the file time and your server in seconds, the following should work. However it requires the use of ksh93.
The output is 120
Hi,
Is there any way to get current time for a particular country using any unix command ?
I mean, If i want to find out current time in US or UK or anything ....
Any command or library routine available for that?
How it can be done in C on Unix?
Can anybody help me?
Thanks
--... (1 Reply)
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 frnds,
I have written a code to get current time
struct tm *locTime;
time_t currentTime;
time( ¤tTime );
locTime = localtime(¤tTime );
Suppose now i get output time as 31-DEC-2007 00:00:00
What i want now is i want two strings where in one string i want to subtract... (1 Reply)
hi,
i've got an input file that contains
12345678 AAA
12345679 BBB
12345680 CCC
where 1st column is epoch time while the second column are some string.
I'm using nawk to do regular expression on the 2nd column and i need to convert the epoch time to human readable time e.g. 'yyyymmdd... (5 Replies)
Hello All,
I have a requirement to convert a 12 hour format to 24 hour time format and the sample input /out put is below
Input Time format : Nov 2 2011 12:16AM
Out Put Format : Nov 2 2011 0:16
Input : Nov 2 2011 4:16PM
Out Put: Nov 2 2011 16:16
I have done this using a... (6 Replies)
Hi there
I came across this script online to convert Epoch time to proper date format, but I am receiving the following error
Also, I have HISTTIMEFORMAT set in user's .profile so that their history output shows time stamps. Additionally I have changed their .history location to a dedicated... (9 Replies)
Hi. I have timestamps that I am trying to convert to epoch time. An example:
I am trying to convert this to an epoch timestamp but have one little glitch. I have this:
import time
date_time = ''
pattern = ''
epoch = int(time.mktime(time.strptime(date_time, pattern)))
print epoch... (1 Reply)
I am trying to convert local time to time in Ireland. Instead it is going the opposite direction (taking the local time as it if were in Ireland and displaying that the time would be here).
$ echo "$TZ"; date; date --date='TZ="Europe/Dublin" '"$(date)"
America/Phoenix
Mon, Apr 13, 2015... (7 Replies)
How can I convert the following date format:
New Log Date = 2016-12-30 23:50:33 GMT
from GMT time to local time?
Thanks (13 Replies)
Discussion started by: mrn6430
13 Replies
LEARN ABOUT DEBIAN
difftime
DIFFTIME(3) Linux Programmer's Manual DIFFTIME(3)NAME
difftime - calculate time difference
SYNOPSIS
#include <time.h>
double difftime(time_t time1, time_t time0);
DESCRIPTION
The difftime() function returns the number of seconds elapsed between time time1 and time time0, represented as a double. Each of the
times is specified in calendar time, which means its value is a measurement (in seconds) relative to the Epoch, 1970-01-01 00:00:00 +0000
(UTC).
CONFORMING TO
SVr4, 4.3BSD, C89, C99.
NOTES
On a POSIX system, time_t is an arithmetic type, and one could just define
#define difftime(t1,t0) (double)(t1 - t0)
when the possible overflow in the subtraction is not a concern. On other systems, the data type time_t might use some other encoding where
subtraction doesn't work directly.
SEE ALSO date(1), gettimeofday(2), time(2), ctime(3), gmtime(3), localtime(3)COLOPHON
This page is part of release 3.44 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 2010-02-25 DIFFTIME(3)