Go to the source code of this file.
|
GWENHYWFAR_API GWEN_TIME * | GWEN_CurrentTime (void) |
|
GWENHYWFAR_API int | GWEN_Time_AddSeconds (GWEN_TIME *ti, uint32_t secs) |
|
GWENHYWFAR_API int | GWEN_Time_Compare (const GWEN_TIME *t1, const GWEN_TIME *t0) |
|
GWENHYWFAR_API double | GWEN_Time_Diff (const GWEN_TIME *t1, const GWEN_TIME *t0) |
|
GWENHYWFAR_API double | GWEN_Time_DiffSeconds (const GWEN_TIME *t1, const GWEN_TIME *t0) |
|
GWENHYWFAR_API GWEN_TIME * | GWEN_Time_dup (const GWEN_TIME *t) |
|
GWENHYWFAR_API void | GWEN_Time_free (GWEN_TIME *t) |
|
GWENHYWFAR_API GWEN_TIME * | GWEN_Time_fromDb (GWEN_DB_NODE *db) |
|
GWENHYWFAR_API GWEN_TIME * | GWEN_Time_fromSeconds (uint32_t s) |
|
GWENHYWFAR_API GWEN_TIME * | GWEN_Time_fromString (const char *s, const char *tmpl) |
|
GWENHYWFAR_API GWEN_TIME * | GWEN_Time_fromUtcString (const char *s, const char *tmpl) |
|
GWENHYWFAR_API int | GWEN_Time_GetBrokenDownDate (const GWEN_TIME *t, int *days, int *month, int *year) |
|
GWENHYWFAR_API int | GWEN_Time_GetBrokenDownTime (const GWEN_TIME *t, int *hours, int *mins, int *secs) |
|
GWENHYWFAR_API int | GWEN_Time_GetBrokenDownUtcDate (const GWEN_TIME *t, int *days, int *month, int *year) |
|
GWENHYWFAR_API int | GWEN_Time_GetBrokenDownUtcTime (const GWEN_TIME *t, int *hours, int *mins, int *secs) |
|
GWENHYWFAR_API double | GWEN_Time_Milliseconds (const GWEN_TIME *t) |
|
GWENHYWFAR_API GWEN_TIME * | GWEN_Time_new (int year, int month, int day, int hour, int min, int sec, int inUtc) |
|
GWENHYWFAR_API uint32_t | GWEN_Time_Seconds (const GWEN_TIME *t) |
|
GWENHYWFAR_API int | GWEN_Time_SubSeconds (GWEN_TIME *ti, uint32_t secs) |
|
GWENHYWFAR_API int | GWEN_Time_toDb (const GWEN_TIME *t, GWEN_DB_NODE *db) |
|
GWENHYWFAR_API int | GWEN_Time_toString (const GWEN_TIME *t, const char *tmpl, GWEN_BUFFER *buf) |
|
GWENHYWFAR_API time_t | GWEN_Time_toTime_t (const GWEN_TIME *t) |
|
GWENHYWFAR_API int | GWEN_Time_toUtcString (const GWEN_TIME *t, const char *tmpl, GWEN_BUFFER *buf) |
|
◆ GWEN_TIME
◆ GWEN_CurrentTime()
◆ GWEN_Time_AddSeconds()
Adds the given number of seconds to the given GWEN_TIME.
- Returns
- 0 if ok, !=0 on error (see Simplified Error Codes)
◆ GWEN_Time_Compare()
◆ GWEN_Time_Diff()
Returns the difference between t1 and t2 in milliseconds
◆ GWEN_Time_DiffSeconds()
Returns the difference between t1 and t2 in seconds
◆ GWEN_Time_dup()
◆ GWEN_Time_free()
◆ GWEN_Time_fromDb()
◆ GWEN_Time_fromSeconds()
◆ GWEN_Time_fromString()
Parses the data and time from the given string according to the template string (quite similar to sscanf).
The string is expected to contain the date/time in local time.
The following characters are accepted in the template string:
Character | Meaning |
Y | digit of the year |
M | digit of the month |
D | digit of the day of month |
h | digit of the hour |
m | digit of the minute |
s | digit of the second |
All other characters are ignored.
Some examples of valid patterns follow:
-
"YYYYMMDD"
-
"YYMMDD"
-
"YY/MM/DD"
-
"YYYYMMDD hh:mm:ss"
-
"YYYYMMDD hh:mm"
-
"YYYYMMDD hhmmss"
-
et cetera
- Returns
- 0 on error, a GWEN_TIME pointer otherwise
- Parameters
-
s | string containing the date/time |
tmpl | template string |
◆ GWEN_Time_fromUtcString()
◆ GWEN_Time_GetBrokenDownDate()
Returns the broken down date as local date.
◆ GWEN_Time_GetBrokenDownTime()
Returns the broken down time as local time.
◆ GWEN_Time_GetBrokenDownUtcDate()
Returns the broken down time as UTC date (Greenwhich Mean time).
◆ GWEN_Time_GetBrokenDownUtcTime()
Returns the broken down time as UTC time (Greenwhich Mean time).
◆ GWEN_Time_Milliseconds()
returns the time in milliseconds
◆ GWEN_Time_new()
Create a time using year, month, day, hour, min, sec.
- Parameters
-
year | year (e.g. 2009) |
month | month (0-11) |
day | day of month (1-31) |
min | minute (0-59) |
sec | second (0-59) |
inUtc | time is given in UTC if !=0 |
◆ GWEN_Time_Seconds()
Returns the time in seconds since the epoch (00:00:00 UTC Jan 1, 1970).
◆ GWEN_Time_SubSeconds()
Subs the given number of seconds from the given GWEN_TIME.
- Returns
- 0 if ok, !=0 on error (see Simplified Error Codes)
◆ GWEN_Time_toDb()
◆ GWEN_Time_toString()
◆ GWEN_Time_toTime_t()
Returns this date as a time_t value (see time(2)).
◆ GWEN_Time_toUtcString()