5#include <flexptp_options.h>
10 ti->
sec = (int64_t)tu->
sec;
18 int64_t ns =
nsI(a) +
nsI(b);
26 int64_t ns =
nsI(a) -
nsI(b);
71static unsigned FIRST_DAY_OF_MONTH[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
74 unsigned fouryear, year, month, day, hour, minute, sec, rem;
102 bool leapyear = year % 4 == 0;
106 for (i = 0; i < 12; i++) {
110 if (day > first1 && day <= first2) {
127 FLEXPTP_SNPRINTF(str, 20,
"%02d-%02d-%04d %02d:%02d:%02d", day, month, year, hour, minute, sec);
int32_t nanosec
nanoseconds
uint32_t nanosec
nanoseconds
uint64_t nsU(const TimestampU *t)
TimestampI * addTime(TimestampI *r, const TimestampI *a, const TimestampI *b)
static unsigned FIRST_DAY_OF_MONTH[]
TimestampI * divTime(TimestampI *r, const TimestampI *a, int divisor)
void normTime(TimestampI *t)
int64_t tsToTick(const TimestampI *ts, uint32_t tps)
TimestampI * nsToTsI(TimestampI *r, int64_t ns)
TimestampI * tsUToI(TimestampI *ti, const TimestampU *tu)
TimestampI * subTime(TimestampI *r, const TimestampI *a, const TimestampI *b)
void tsPrint(char *str, const TimestampI *ts)
bool nonZeroI(const TimestampI *a)
int64_t nsI(const TimestampI *t)
This module defines storage classes for timestamps and operations on time values.
#define T_SEC_PER_MINUTE
seconds per minute
#define NANO_PREFIX
Integer nano prefix.
#define T_SEC_PER_FOURYEAR
seconds per four years
#define T_SEC_PER_YEAR
seconds per year
#define T_SEC_PER_HOUR
seconds per hour
#define T_SEC_PER_DAY
seconds per day
#define T_SEC_PER_LEAPYEAR
seconds per leapyear