Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
date_time_struct.hpp
Go to the documentation of this file.
1#pragma once
6#ifndef _TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
7#define _TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
8
9namespace time_shield {
10
13 int64_t year;
14 int mon;
15 int day;
16 int hour;
17 int min;
18 int sec;
19 int ms;
20 };
21
32 const int64_t& year,
33 const int& mon = 1,
34 const int& day = 1,
35 const int& hour = 0,
36 const int& min = 0,
37 const int& sec = 0,
38 const int& ms = 0) {
39 DateTimeStruct date_time;
40 date_time.year = year;
41 date_time.mon = mon;
42 date_time.day = day;
43 date_time.hour = hour;
44 date_time.min = min;
45 date_time.sec = sec;
46 date_time.ms = ms;
47 return date_time;
48 }
49
50}; // namespace time_shield
51
52#endif // _TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
Main namespace for the Time Shield library.
Definition constants.hpp:12
const DateTimeStruct create_date_time_struct(const int64_t &year, const int &mon=1, const int &day=1, const int &hour=0, const int &min=0, const int &sec=0, const int &ms=0)
Creates a DateTimeStruct instance.
TIME_SHIELD_CONSTEXPR const T year(const ts_t &ts=ts())
Alias for get_year function.
Structure to represent date and time.
int ms
Millisecond component of time (0-999)
int hour
Hour component of time (0-23)
int64_t year
Year component of the date.
int day
Day component of the date (1-31).
int min
Minute component of time (0-59)
int mon
Month component of the date (1-12).
int sec
Second component of time (0-59)