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.
A copy of the time value may be saved to the area indicated by the pointer tloc. If tloc is a NULL pointer, no value is stored.
Upon successful completion, time() returns the value of time. Otherwise a value of ((time_t) -1) is returned and the global variable errno
is set to indicate the error.
ERRORS
No errors are defined.
SEE ALSO gettimeofday(2), ctime(3)STANDARDS
The time() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1'').
HISTORY
A time() function appeared in Version 2 AT&T UNIX. It returned a 32-bit value measuring sixtieths of a second, leading to rollover every
2.26 years. In Version 6 AT&T UNIX, the precision of time() was changed to seconds, allowing 135.6 years between rollovers.
In NetBSD 6.0 the time_t type was changed to be 64 bits wide, including on 32-bit machines, making rollover a concern for the far distant
future only. Note however that any code making the incorrect assumption that time_t is the same as long will fail on 32-bit machines in
2038.
BSD November 5, 2011 BSD
Check Out this Related Man Page
time(2) System Calls time(2)NAME
time - get time
SYNOPSIS
#include <sys/types.h>
#include <time.h>
time_t time(time_t *tloc);
DESCRIPTION
The time() function returns the value of time in seconds since 00:00:00 UTC, January 1, 1970.
If tloc is non-zero, the return value is also stored in the location to which tloc points. If tloc points to an illegal address, time()
fails and its actions are undefined.
RETURN VALUES
Upon successful completion, time() returns the value of time. Otherwise, (time_t)-1 is returned and errno is set to indicate the error.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO stime(2), ctime(3C), attributes(5), standards(5)SunOS 5.11 28 Dec 1996 time(2)
I am currently a student at Bergen Community College. My major is Networking Administration. I am having a tough time with INF-254 (UNIX).
I need some help! What is "README bit"
I am having trouble understanding certain concepts:
For Example, what does it mean to set SUID, or SGID?
... (1 Reply)
Hi,
I am new to C in UNIX.
I am trying to understanding the C code someone wrote 10 years ago and hoping to get it work again.
While reading his code, I found 'iret ' variable, what does this normally mean?
looks like its integer, but why called ret?
....
int iret;
FILE *perlptr;... (1 Reply)
someone please help me out here.
i am not a newbie. i just haven't posted on this board in years. i'm talking at least two and a half years. My last user name was TRUEST. i couldn't log into this name because i forgot my password and my aol email address has long been deleted.
anyway, i'm... (1 Reply)
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)
I have been running 5.0.02 for more than 10 years in its present configuration. I am running a business software package on it (text based).
I am trying to use my windows machines to access it through a program like "reflections" so that I can run my software from different systems but I get... (2 Replies)
I haven't used UNIX is several years. But I became pretty good at it and love it. But I am rusty.
I know this is basic, but how do you copy and paste?
The user guide says what I remember, to highlight the text and the right-click. But it isn't working.
I don't know if this will matter,... (2 Replies)
I am using Korn Shell to process one file at a time. In a recieve directory i have mutiple file but would like to only copy one file at a time. Here i wrote a following code but i am getting find: can not stat error on following line. File exit in the directory. Currently i have 777 privelage to... (1 Reply)
Hi guys,
I'm completely new to UNIX and Linux and all that stuff. I've been using webhosting (shared) for some time years now and recently I've wanted to carry out some tasks that have had some commands which are not familiar to me. One was to install Mailman and the other to copy files from one... (6 Replies)
Helllo UNIX Forum :)
Since I am posting on this board, yes, I am new to UNIX!
I read a copy of "UNIX made easy" from 1990, which felt like a making a "computer-science time jump" backwards ;)
So, basically I have some sort of understanding what the basic concept is.
Problem Description:... (6 Replies)
Hello,
Three of our machines at work were sending out SPAM on the internet. 2 of them were so old I knew that the hackers just exploited the vulnerabilities in the old systems. The cause of concern is that one one of the machines is a new Centos 5.3 box.The only proof we have is that 4-6 emails... (3 Replies)
Hello - I have a folder that contains files from 2003 till 2010. I am trying to figure out a command that would seperate each years file and show me a count?
Even if i can find a command that would give me year by year count, thats good enough too.
Thanks (8 Replies)
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)
Folks,
I am hoping someone out there can help me. I have been writing code for in-excess of 10 years. Throughout all this time I have used Xemacs. I have picked up bits of customizations here and there over the years, but would not profess to be anything of an expert in Lisp (or have a heavily... (3 Replies)
Perhaps a story in the making....
In 2 years or so my company is purchasing a new computer system for our distributing business. Right now, we have an AIX 5.3 machine and some other servers that I admin. I do not have a college degree. My tech knowledge is mostly experience. I have not studied... (7 Replies)
Hi,
I have been working in India since past 13 years and as per Indian IT culture, there will be saturation in Salary which barely matches with rising living costs in India.
I am thinking to move/work in some other country for few years at least which help me financially plus technically. As of... (3 Replies)