Private UTC timestamp conversion helpers for the logger_default adapter.
More...
Go to the source code of this file.
This file implements private helpers used to convert epoch-time values into decomposed UTC+0 civil timestamps for logger_default log formatting.
Definition in file logger_default_utc_timestamp.c.
◆ logger_default_days_in_month()
| static int32_t logger_default_days_in_month |
( |
int32_t |
year, |
|
|
int32_t |
month |
|
) |
| |
|
static |
- Parameters
-
| [in] | year | Gregorian calendar year. |
| [in] | month | Gregorian calendar month in the range [1, 12]. |
- Returns
- Number of days in the requested month for the requested year.
Definition at line 66 of file logger_default_utc_timestamp.c.
◆ logger_default_days_in_year()
| static int32_t logger_default_days_in_year |
( |
int32_t |
year | ) |
|
|
static |
◆ logger_default_epoch_time_to_date()
This helper interprets time->epoch_seconds as a UTC+0 Unix epoch-time value and converts it into calendar and clock fields stored in *out.
- Parameters
-
| [out] | out | Receives the converted UTC timestamp. Must not be NULL. |
| [in] | time | Epoch-time value to convert. Must not be NULL. |
- Return values
-
| true | Conversion succeeded and *out was populated. |
| false | One or more arguments are invalid. |
Definition at line 102 of file logger_default_utc_timestamp.c.
◆ logger_default_is_leap_year()
| static bool logger_default_is_leap_year |
( |
int32_t |
year | ) |
|
|
static |
A year is leap if it is divisible by 4, except century years that are not divisible by 400.
- Parameters
-
| [in] | year | Gregorian calendar year. |
- Return values
-
| true | year is a leap year. |
| false | year is not a leap year. |
Definition at line 35 of file logger_default_utc_timestamp.c.