Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

time(3) [osx man page]

TIME(3) 						   BSD Library Functions Manual 						   TIME(3)

NAME
time -- get time of day LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <time.h> time_t time(time_t *tloc); DESCRIPTION
The time() function returns the value of time in seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal Time, without including leap seconds. If an error occurs, time() returns the value (time_t)-1. The return value is also stored in *tloc, provided that tloc is non-null. ERRORS
The time() function may fail for any of the reasons described in gettimeofday(2). SEE ALSO
gettimeofday(2), ctime(3) STANDARDS
The time function conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A time() function appeared in Version 6 AT&T UNIX. BUGS
Neither ISO/IEC 9899:1999 (``ISO C99'') nor IEEE Std 1003.1-2001 (``POSIX.1'') requires time() to set errno on failure; thus, it is impossi- ble for an application to distinguish the valid time value -1 (representing the last UTC second of 1969) from the error return value. Systems conforming to earlier versions of the C and POSIX standards (including older versions of FreeBSD) did not set *tloc in the error case. BSD
July 18, 2003 BSD

Check Out this Related Man Page

TIME(2) 						     Linux Programmer's Manual							   TIME(2)

NAME
time - get time in seconds SYNOPSIS
#include <time.h> time_t time(time_t *t); DESCRIPTION
time returns the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds. If t is non-NULL, the return value is also stored in the memory pointed to by t. RETURN VALUE
On success, the value of time in seconds since the Epoch is returned. On error, ((time_t)-1) is returned, and errno is set appropriately. ERRORS
EFAULT t points outside your accessible address space. NOTES
POSIX.1 defines seconds since the Epoch as a value to be interpreted as the number of seconds between a specified time and the Epoch, according to a formula for conversion from UTC equivalent to conversion on the naive basis that leap seconds are ignored and all years divisible by 4 are leap years. This value is not the same as the actual number of seconds between the time and the Epoch, because of leap seconds and because clocks are not required to be synchronised to a standard reference. The intention is that the interpretation of sec- onds since the Epoch values be consistent; see POSIX.1 Annex B 2.2.2 for further rationale. CONFORMING TO
SVr4, SVID, POSIX, X/OPEN, BSD 4.3 Under BSD 4.3, this call is obsoleted by gettimeofday(2). POSIX does not specify any error conditions. SEE ALSO
ctime(3), date(1), ftime(3), gettimeofday(2) Linux 2.0.30 1997-09-09 TIME(2)
Man Page

2 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How To Fetch Time From Putside Source On Unix Platform?

CAN ANY PLESE TEL ME,HOW CAN I FETCH TIME FROM SOME EXTERNAL SOURCE (eg. NETWORK TIME SERVER S 200) ON UNIX PLATFORM,PROVIDED TIME IS COMING FROM SOME IP "X".WHAT CODE SHOULD I RUN IN STARTUP (2 Replies)
Discussion started by: pesty
2 Replies

2. AIX

AIX TIME CHANGE

Hi Guys , I see a weird problem with one of the AIX Machine, The time is changing randomly on the server. The seconds part of the time is what is the problem which is jumping on a uneven order and coming back to the original state after some time and again the same.. I have collected the time... (8 Replies)
Discussion started by: kkeng808
8 Replies