settimeofday

Sets the time

Library:LibC
Classification:BSD
Service:Time

Syntax

  #include <sys/time.h> 
   
  int settimeofday (
     struct timeval    *tp,
     struct timezone   *tpz);
  

Parameters

tp

(IN) Points to the time. If tpz is zero or the tz_secondswest and tz_minuteswest are zero, the incoming time must be UTC.

tpz

(IN) Points to a structure containing timezone information if the time in the tp parameter is not specified as UTC time. The information in the tpz parameter is not used to set the timezone.

Return Values

If successful, returns 0. Otherwise, returns -1 and sets errno.

Decimal

Constant

Description

79

ENOTSUP

The settimeofday function is not supported in Ring 3.

Remarks

The settimeofday function sets the current date and time for the system, but it cannot be use to set the time zone.

See Also

gettimeofday