HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

time

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Returns the number of seconds since the Epoch.

Syntax

   #include <time.h>

   time_t time (time_t *tloc);

Parameters

tloc

If not NULL, a pointer to a variable of type time_t where the number of seconds since the Epoch is returned. If NULL, no value is stored.

Return Values

>=0

Success.

-1

An error occurred. The time is not returned, and errno is set to indicate the error condition.

Description

The time() function calculates and returns the number of seconds since the last Epoch (00:00:00 Coordinated Universal Time (UTC) January 1, 1970).

If tloc is not NULL, the same value is returned in the variable pointed to by tloc. If tloc is NULL, no value is returned in tloc.

Implementation Considerations

Refer to the EFAULT error description below.

The TZ environment variable does not affect this function.

Errors

If an error occurs, errno is set to the following value:

EFAULTCAUSEThe system detected a bad address in attempting to use the tloc parameter.
 ACTIONMake sure that the pointer is correctly initialized.

See Also

<time.h>, POSIX.1 (Section 4.5.1)

Feedback to webmaster