1#ifndef SOURCEMETA_CORE_TIME_H_
2#define SOURCEMETA_CORE_TIME_H_
4#ifndef SOURCEMETA_CORE_TIME_EXPORT
5#include <sourcemeta/core/time_export.h>
26namespace sourcemeta::core {
39SOURCEMETA_CORE_TIME_EXPORT
59SOURCEMETA_CORE_TIME_EXPORT
61 -> std::optional<std::chrono::system_clock::time_point>;
74SOURCEMETA_CORE_TIME_EXPORT
95SOURCEMETA_CORE_TIME_EXPORT
97 -> std::optional<std::chrono::system_clock::time_point>;
111SOURCEMETA_CORE_TIME_EXPORT
112auto to_asctime(
const std::chrono::system_clock::time_point time)
132SOURCEMETA_CORE_TIME_EXPORT
134 -> std::optional<std::chrono::system_clock::time_point>;
147SOURCEMETA_CORE_TIME_EXPORT
162SOURCEMETA_CORE_TIME_EXPORT
164 -> std::optional<std::chrono::system_clock::time_point>;
183SOURCEMETA_CORE_TIME_EXPORT
185 -> std::optional<std::chrono::system_clock::time_point>;
200SOURCEMETA_CORE_TIME_EXPORT
202 const std::chrono::system_clock::time_point time)
noexcept
203 -> std::chrono::duration<double>;
220SOURCEMETA_CORE_TIME_EXPORT
222 const std::chrono::seconds span)
noexcept
223 -> std::chrono::system_clock::time_point;
240SOURCEMETA_CORE_TIME_EXPORT
242 const std::chrono::seconds span)
noexcept
243 -> std::chrono::system_clock::time_point;
267SOURCEMETA_CORE_TIME_EXPORT
292SOURCEMETA_CORE_TIME_EXPORT
319SOURCEMETA_CORE_TIME_EXPORT
346SOURCEMETA_CORE_TIME_EXPORT
372SOURCEMETA_CORE_TIME_EXPORT
390 return (year % 4 == 0) && (year % 100 != 0 || year % 400 == 0);
408 const std::uint16_t year)
410 assert(month >= 1 && month <= 12);
411 constexpr std::array<std::uint8_t, 13> days{
412 {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
SOURCEMETA_CORE_TIME_EXPORT auto clock_shift_forward(const std::chrono::system_clock::time_point time, const std::chrono::seconds span) noexcept -> std::chrono::system_clock::time_point
SOURCEMETA_CORE_TIME_EXPORT auto is_rfc3339_fulldate(const std::string_view value) -> bool
SOURCEMETA_CORE_TIME_EXPORT auto to_iso8601_basic(const std::chrono::system_clock::time_point time) -> std::string
SOURCEMETA_CORE_TIME_EXPORT auto to_unix_timestamp(const std::chrono::system_clock::time_point time) noexcept -> std::chrono::duration< double >
SOURCEMETA_CORE_TIME_EXPORT auto is_rfc3339_datetime(const std::string_view value) -> bool
SOURCEMETA_CORE_TIME_EXPORT auto to_imf_fixdate(const std::chrono::system_clock::time_point time) -> std::string
SOURCEMETA_CORE_TIME_EXPORT auto to_rfc850_date(const std::chrono::system_clock::time_point time) -> std::string
SOURCEMETA_CORE_TIME_EXPORT auto to_asctime(const std::chrono::system_clock::time_point time) -> std::string
SOURCEMETA_CORE_TIME_EXPORT auto from_iso8601_basic(const std::string_view value) noexcept -> std::optional< std::chrono::system_clock::time_point >
SOURCEMETA_CORE_TIME_EXPORT auto is_rfc3339_partialtime_no_secfrac(const std::string_view value) -> bool
SOURCEMETA_CORE_TIME_EXPORT auto from_unix_timestamp(const std::chrono::duration< double > seconds) noexcept -> std::optional< std::chrono::system_clock::time_point >
constexpr auto is_leap_year(const std::uint16_t year) -> bool
Definition time.h:389
SOURCEMETA_CORE_TIME_EXPORT auto from_rfc850_date(const std::string_view value) noexcept -> std::optional< std::chrono::system_clock::time_point >
SOURCEMETA_CORE_TIME_EXPORT auto from_asctime(const std::string_view value) noexcept -> std::optional< std::chrono::system_clock::time_point >
SOURCEMETA_CORE_TIME_EXPORT auto is_rfc3339_duration(const std::string_view value) -> bool
SOURCEMETA_CORE_TIME_EXPORT auto clock_shift_backward(const std::chrono::system_clock::time_point time, const std::chrono::seconds span) noexcept -> std::chrono::system_clock::time_point
constexpr auto max_day_in_month(const std::uint8_t month, const std::uint16_t year) -> std::uint8_t
Definition time.h:407
SOURCEMETA_CORE_TIME_EXPORT auto is_rfc3339_fulltime(const std::string_view value) -> bool
SOURCEMETA_CORE_TIME_EXPORT auto from_imf_fixdate(const std::string_view value) noexcept -> std::optional< std::chrono::system_clock::time_point >