clibs
Tiny but handy utility libraries for C
Functions
clibs_time.h File Reference

Common time operations. More...

#include <time.h>
Include dependency graph for clibs_time.h:

Go to the source code of this file.

Functions

struct tm date_create (int year, int month, int day)
 Create a date object. More...
 
struct tm time_create (int year, int month, int day, int hour, int min, int sec)
 Create a time object. More...
 

Detailed Description

Common time operations.

Author
ByteBard

Function Documentation

◆ date_create()

struct tm date_create ( int  year,
int  month,
int  day 
)

Create a date object.

Parameters
yearyear in Gregorian calendar
monthfrom 1 to 12
dayfrom 1 to 31
Returns
struct tm

Time is kept at 9:00 AM.

◆ time_create()

struct tm time_create ( int  year,
int  month,
int  day,
int  hour,
int  min,
int  sec 
)

Create a time object.

Parameters
yearyear in Gregorian calendar
monthfrom 1 to 12
dayfrom 1 to 31
hourfrom 0 to 23
minfrom 0 to 59
secfrom 0 to 59
Returns
struct tm