Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
date_struct.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef _TIME_SHIELD_DATE_STRUCT_HPP_INCLUDED
3#define _TIME_SHIELD_DATE_STRUCT_HPP_INCLUDED
4
9
10namespace time_shield {
11
14 struct DateStruct {
15 int64_t year;
16 int32_t mon;
17 int32_t day;
18 };
19
27 int64_t year,
28 int32_t mon = 1,
29 int32_t day = 1) {
30 DateStruct data{year, mon, day};
31 return data;
32 }
33
34}; // namespace time_shield
35
36#endif // _TIME_SHIELD_DATE_STRUCT_HPP_INCLUDED
TIME_SHIELD_CONSTEXPR const T year(ts_t ts=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.