setPeriod()

Sets t to a particular number of seconds and milliseconds.

Synopsis

time setPeriod(time &t, unsigned seconds [, unsigned milli]);

Parameters

Parameter Description
t Time
seconds Seconds
milli Milliseconds

Return value

Equal to the value of t, in the event of errors -1 (represents as value "1970.01.01 01:00:00.000000000").

Errors

missing/incorrect arguments

Description

The function setPeriod()sets the variable t in the internal format to the time seconds seconds and milli milliseconds after 1.1.1970, 00:00 UTC. The specification of milliseconds, argument milli is optional, its default value is zero.

The transferred arguments can either be interpreted as a time after 1.1.1970, 00:00 UTC, or simply as a time period (Query by period()).

Example

main()
{
  time t;
  setPeriod(t, 864000); //10 days (after 1.1.1970);
}

Assignment

Time function

Availability

CTRL