Source
int zbx_tm_parse_period(const char *period, size_t *len, int *multiplier, zbx_time_unit_t *base, char **error);
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
typedef struct
{
int sec; /* seconds */
int ns; /* nanoseconds */
}
zbx_timespec_t;
/* time zone offset */
typedef struct
{
char tz_sign; /* '+' or '-' */
int tz_hour;
int tz_min;
}
zbx_timezone_t;
typedef enum
{
ZBX_TIME_UNIT_UNKNOWN,
ZBX_TIME_UNIT_SECOND,
ZBX_TIME_UNIT_MINUTE,
ZBX_TIME_UNIT_HOUR,
ZBX_TIME_UNIT_DAY,
ZBX_TIME_UNIT_WEEK,
ZBX_TIME_UNIT_MONTH,
ZBX_TIME_UNIT_YEAR,
ZBX_TIME_UNIT_ISOYEAR,
ZBX_TIME_UNIT_COUNT
}
zbx_time_unit_t;
double zbx_time(void);
void zbx_timespec(zbx_timespec_t *ts);
double zbx_current_time(void);
int zbx_is_leap_year(int year);
void zbx_get_time(struct tm *tm, long *milliseconds, zbx_timezone_t *tz);