Time-related


Typedefs

typedef long clock_t
typedef clock_t time_t

Functions

clock_t clock (void)
time_t time (void)
time_t get_trusted_time (void)


Compounds

     struct   TimeA time manipulation structure


Detailed Description

Some functions for setting and changing the date and time. Please look at the Time structure


Typedef Documentation

typedef long clock_t
 

Stores time values: used by the clock() function.

See also:
clock.

typedef clock_t time_t
 

Represents time values in the time() function and Time object.

See also:
time.


Function Documentation

clock_t clock ( void )
 

Returns the time from the system startup in milliseconds; updated every 10 mS.

Returns:
a clock_t value.
       #include <cybiko.h>
       ...
       int value;
       ...
       // Initializes a pseudorandom sequence.
       srand( clock() );
       ...
       value = random( 10 );

time_t get_trusted_time ( void )
 

Returns trusted time.
This time is synchronized with the Cybiko web server. The user cannot change the trusted time.

Returns:
The trusted time.
       #include <cybiko.h>
       ...
       struct Time time;
       ...
       Time_decode( &time, get_trusted_time() );
       //  Synchronizes real time clock with the trusted time.
       Time_set_RTC( &time );
       ...

time_t time ( void )
 

Returns the current time in the system format (seconds since some date).

Returns:
Time in the time_t format (seconds since some date).
       #include <cybiko.h>
       ...
       int week_day;
       struct Time cur_time;
       ...
       Time_decode( &cur_time, time() );
       ...
       week_day = Time_get_weekday( &cur_time );
See also:
Time_encode.