-
Notifications
You must be signed in to change notification settings - Fork 0
/
clibs_time.h
36 lines (32 loc) · 984 Bytes
/
clibs_time.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** @file clibs_time.h
* @brief Common time operations.
* @author ByteBard
* @copyright MIT
*/
#ifndef CLIBS_TIME_H
#define CLIBS_TIME_H
#include <time.h>
/** @fn struct tm date_create(int year, int month, int day)
* @brief Create a date object.
* @param year year in Gregorian calendar
* @param month from 1 to 12
* @param day from 1 to 31
* @return struct tm
*
* Time is kept at 9:00 AM.
*/
struct tm date_create(
int year, int month, int day);
/** @fn struct tm time_create(int year, int month, int day, int hour, int min, int sec)
* @brief Create a time object.
* @param year year in Gregorian calendar
* @param month from 1 to 12
* @param day from 1 to 31
* @param hour from 0 to 23
* @param min from 0 to 59
* @param sec from 0 to 59
* @return struct tm
*/
struct tm time_create(
int year, int month, int day, int hour, int min, int sec);
#endif /* CTIME_UTILS_H */