Time Shield Library
C++ library for working with time
Toggle main menu visibility
Loading...
Searching...
No Matches
date_time_struct.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
#pragma once
3
#ifndef TIME_SHIELD_HEADER_TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
4
#define TIME_SHIELD_HEADER_TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
5
10
11
#include <cstdint>
12
13
namespace
time_shield
{
14
17
struct
DateTimeStruct
{
18
int64_t
year
;
19
int
mon
;
20
int
day
;
21
int
hour
;
22
int
min
;
23
int
sec
;
24
int
ms
;
25
};
26
37
inline
const
DateTimeStruct
create_date_time_struct
(
38
int64_t
year
,
39
int
mon = 1,
40
int
day = 1,
41
int
hour = 0,
42
int
min = 0,
43
int
sec = 0,
44
int
ms = 0) {
45
DateTimeStruct
date_time;
46
date_time.
year
=
year
;
47
date_time.
mon
= mon;
48
date_time.
day
= day;
49
date_time.
hour
= hour;
50
date_time.
min
= min;
51
date_time.
sec
= sec;
52
date_time.
ms
= ms;
53
return
date_time;
54
}
55
56
};
// namespace time_shield
57
58
#endif
// TIME_SHIELD_HEADER_TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
time_shield::year
TIME_SHIELD_CONSTEXPR T year(ts_t ts=time_shield::ts())
Alias for year_of function.
Definition
time_conversion_aliases.hpp:1591
time_shield::create_date_time_struct
const DateTimeStruct create_date_time_struct(int64_t year, int mon=1, int day=1, int hour=0, int min=0, int sec=0, int ms=0)
Creates a DateTimeStruct instance.
Definition
date_time_struct.hpp:37
time_shield
Main namespace for the Time Shield library.
time_shield::DateTimeStruct
Structure to represent date and time.
Definition
date_time_struct.hpp:17
time_shield::DateTimeStruct::ms
int ms
Millisecond component of time (0-999).
Definition
date_time_struct.hpp:24
time_shield::DateTimeStruct::hour
int hour
Hour component of time (0-23).
Definition
date_time_struct.hpp:21
time_shield::DateTimeStruct::year
int64_t year
Year component of the date.
Definition
date_time_struct.hpp:18
time_shield::DateTimeStruct::day
int day
Day component of the date (1-31).
Definition
date_time_struct.hpp:20
time_shield::DateTimeStruct::min
int min
Minute component of time (0-59).
Definition
date_time_struct.hpp:22
time_shield::DateTimeStruct::mon
int mon
Month component of the date (1-12).
Definition
date_time_struct.hpp:19
time_shield::DateTimeStruct::sec
int sec
Second component of time (0-59).
Definition
date_time_struct.hpp:23
include
time_shield
date_time_struct.hpp
Generated by
1.17.0