A comprehensive set of functions and utilities for working with timestamps and time-related data.
More...
A comprehensive set of functions and utilities for working with timestamps and time-related data.
This module provides functionalities to convert, manipulate, and analyze timestamps in seconds, milliseconds, and floating-point formats. It also includes utilities for working with date-time structures, UNIX days, and various time units (hours, minutes, seconds, etc.).
Key Features:
- Convert timestamps between seconds, milliseconds, and floating-point seconds.
- Extract components such as nanoseconds, microseconds, and milliseconds from timestamps.
- Convert timestamps to and from date-time structures.
- Calculate the start and end of various time intervals (e.g., days, hours, months, years).
- Analyze time data (e.g., day of the week, day of the year, days in a month or year).
Usage Examples:
- Obtain the millisecond component of a timestamp:
const T ms_of_sec() noexcept
Get the millisecond part of the current second.
- Convert a date-time structure to a timestamp:
TIME_SHIELD_CONSTEXPR const ts_t to_timestamp(const T &date_time)
Alias for dt_to_timestamp function.
- Determine the start of the current year:
TIME_SHIELD_CONSTEXPR const ts_t start_of_year(ts_t ts) noexcept
Get the start of the year timestamp.