Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
date_struct.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2#pragma once
3#ifndef _TIME_SHIELD_DATE_STRUCT_HPP_INCLUDED
4#define _TIME_SHIELD_DATE_STRUCT_HPP_INCLUDED
5
10
11namespace time_shield {
12
15 struct DateStruct {
16 int64_t year;
17 int32_t mon;
18 int32_t day;
19 };
20
28 int64_t year,
29 int32_t mon = 1,
30 int32_t day = 1) {
31 DateStruct data{year, mon, day};
32 return data;
33 }
34
35}; // namespace time_shield
36
37#endif // _TIME_SHIELD_DATE_STRUCT_HPP_INCLUDED
TIME_SHIELD_CONSTEXPR T year(ts_t ts=time_shield::ts())
Alias for get_year function.
const DateStruct create_date_struct(int64_t year, int32_t mon=1, int32_t day=1)
Creates a DateStruct instance.
Main namespace for the Time Shield library.
Structure to represent a date.
int32_t mon
Month component of the date (1-12).
int32_t day
Day component of the date (1-31).
int64_t year
Year component of the date.