Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

time(3) [netbsd 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. 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(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
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

question on UNIX material

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)
Discussion started by: nelson ele
1 Replies

2. Programming

iret

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)
Discussion started by: whatisthis
1 Replies

3. UNIX for Dummies Questions & Answers

problem with if -z string

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)
Discussion started by: Terrible
1 Replies

4. 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

5. UNIX for Dummies Questions & Answers

SCO UNIX "TCP/IP not licensed error"

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)
Discussion started by: Parkegio
2 Replies

6. UNIX for Dummies Questions & Answers

Dumbest UNIX question ever

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)
Discussion started by: arungavali
2 Replies

7. UNIX for Dummies Questions & Answers

Copying one file at a time

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)
Discussion started by: ali_amir24
1 Replies

8. UNIX for Dummies Questions & Answers

How to execute a command on UNIX?

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)
Discussion started by: BenA
6 Replies

9. UNIX for Dummies Questions & Answers

single output of awk script processing multiple files

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)
Discussion started by: Kasimir
6 Replies

10. Cybersecurity

How were UNIX machines taken over by SPAMMERS?

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)
Discussion started by: mojoman
3 Replies

11. UNIX for Dummies Questions & Answers

Unix Command to separate this years files and last years?

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)
Discussion started by: DallasT
8 Replies

12. 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

13. UNIX for Advanced & Expert Users

About to give up on XEmacs 21.5.29

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)
Discussion started by: petermc
3 Replies

14. War Stories

Time travel

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)
Discussion started by: herot
7 Replies

15. What is on Your Mind?

UNIX field scope in European countries

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)
Discussion started by: nightup2222
3 Replies