MentOS  0.8.0
The Mentoring Operating System
Functions | Variables
time.c File Reference

Clock functions. More...

Functions

time_t sys_time (time_t *time)
 Returns the current time. More...
 
time_t difftime (time_t time1, time_t time2)
 Return the difference between the two time values. More...
 
static int day_of_week (unsigned int y, unsigned int m, unsigned int d)
 Computes day of week. More...
 
tm_tlocaltime (const time_t *time)
 The current time broken down into a tm_t structure. More...
 

Variables

static const char * str_weekdays []
 List of week days. More...
 
static const char * str_months []
 List of months. More...
 

Detailed Description

Clock functions.

Function Documentation

◆ day_of_week()

static int day_of_week ( unsigned int  y,
unsigned int  m,
unsigned int  d 
)
inlinestatic

Computes day of week.

Parameters
yYear
mMonth of year (in range 1 to 12)
dDay of month (in range 1 to 31)
Returns
Day of week (in range 1 to 7)

◆ difftime()

time_t difftime ( time_t  time1,
time_t  time2 
)

Return the difference between the two time values.

Parameters
time1The first time value.
time2The second time value.
Returns
The difference in terms of seconds.

◆ localtime()

tm_t* localtime ( const time_t timep)

The current time broken down into a tm_t structure.

Parameters
timepA pointer to a variable holding the current time.
Returns
The time broken down.

◆ sys_time()

time_t sys_time ( time_t time)

Returns the current time.

Parameters
timeWhere the time should be stored.
Returns
The current time.

Variable Documentation

◆ str_months

const char* str_months[]
static
Initial value:
= {
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
}

List of months.

◆ str_weekdays

const char* str_weekdays[]
static
Initial value:
= {
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
}

List of week days.