difftime(3C) Standard C Library Functions difftime(3C)NAME
difftime - computes the difference between two calendar times
SYNOPSIS
#include <time.h>
double difftime(time_t time1, time_t time0);
DESCRIPTION
The difftime() function computes the difference between two calendar times.
RETURN VALUES
The difftime() functions returns the difference (time1-time0) expressed in seconds as a double.
USAGE
The difftime() function is provided because there are no general arithmetic properties defined for type time_t.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO ctime(3C), attributes(5), standards(5)SunOS 5.11 24 Jul 2002 difftime(3C)
Check Out this Related Man Page
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).
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+-----------+---------------+---------+
|Interface | Attribute | Value |
+-----------+---------------+---------+
|difftime() | Thread safety | MT-Safe |
+-----------+---------------+---------+
CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD.
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.
SEE ALSO date(1), gettimeofday(2), time(2), ctime(3), gmtime(3), localtime(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 2015-08-08 DIFFTIME(3)
This is probably a stupid question to ask. But could somebody help me clearly distinguish the difference between these two operators in unix '==' and '='? (7 Replies)
HI ,
I need to get the timedifference between two values... which funcation will help
eg: difference betweem 19:22 and 19:43 should give 21 mins (2 Replies)
May i know the difference between the execution of the commands:
./example.sh
. /example.sh and
./ example.sh
the last and last but one is having space in between that is the difference please suggest me the answer for this...:confused: (4 Replies)
i am confused with firewalls and vpns(virtual private netwoks)
can anyone clarify it and let me know is there any document or book to read
bye (2 Replies)
Hi All,
I know there has been a lot of things that have been written about date arithmetic, but perhaps I have missed something..
The following script takes the input from a file name fail.txt with the following format:
CLASSDB 20060328122808
CPPARMS 20060814222056
Where $1 is a file name... (4 Replies)
Hi,
START_TIME :- "10-NOV-2009 00:00:04"
STOP_TIME :- "10-NOV-2009 00:05:47"
Please help to find difference between these two.
Searched for the same topic but did not find an answer for the same time format :(
Regards,
Robin (3 Replies)
I am a member of a few different user groups.
I would like to see what the difference is....
Can anyone tell me how to look at permissions side by side ?
We are using :
SunOS xxxxxx 5.10 Generic_127111-09 sun4u sparc SUNW,Sun-Fire-V440
Thanks ! (10 Replies)
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)
Hi ,
I want to find out the time difference. If the system date and time is "Jul 18 05:39:00" EST then it should return "Jul 18 04:39:00". i.e one hour differnce in time. Pls help me out.
Other eg's : Jul 18 00:00:00 -> Jul 18 23:00:00
Jul 18 01:00:00 -> Jul 17 00:00:00 (3 Replies)
Hello Experts,
I need to evaluate my API performance, so need a script to get the time difference for all the transaction that has gone through my application in a day. The challenge is the multi threaded logs, so I cant just get all the Telephone Numbers and check the entering and existing... (5 Replies)