Time Shield Library
C++ library for working with time
Toggle main menu visibility
Loading...
Searching...
No Matches
date_struct.mqh
Go to the documentation of this file.
1
//+------------------------------------------------------------------+
2
//| date_struct.mqh |
3
//| Time Shield - MQL5 Date Structure |
4
//| Copyright 2025, NewYaroslav |
5
//| https://github.com/NewYaroslav/time-shield-cpp |
6
//+------------------------------------------------------------------+
7
#ifndef TIME_SHIELD_MQL5_HEADER_TIME_SHIELD_DATE_STRUCT_MQH_INCLUDED
8
#define TIME_SHIELD_MQL5_HEADER_TIME_SHIELD_DATE_STRUCT_MQH_INCLUDED
9
16
17
#property copyright "Copyright 2025, NewYaroslav"
18
#property link "https://github.com/NewYaroslav/time-shield-cpp"
19
#property strict
20
21
namespace
time_shield
{
22
25
struct
DateStruct
{
26
long
year
;
27
int
mon
;
28
int
day
;
29
};
30
37
DateStruct
create_date_struct
(
const
long
year
,
const
int
mon = 1,
const
int
day = 1) {
38
DateStruct
result;
39
result.year =
year
;
40
result.mon = mon;
41
result.day = day;
42
return
result;
43
}
44
45
};
// namespace time_shield
46
47
#endif
// TIME_SHIELD_MQL5_HEADER_TIME_SHIELD_DATE_STRUCT_MQH_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_struct
const DateStruct create_date_struct(int64_t year, int32_t mon=1, int32_t day=1)
Creates a DateStruct instance.
Definition
date_struct.hpp:27
time_shield
Main namespace for the Time Shield library.
time_shield::DateStruct
Structure to represent a date.
Definition
date_struct.hpp:15
time_shield::DateStruct::mon
int32_t mon
Month component of the date (1-12).
Definition
date_struct.hpp:17
time_shield::DateStruct::day
int32_t day
Day component of the date (1-31).
Definition
date_struct.hpp:18
time_shield::DateStruct::year
int64_t year
Year component of the date.
Definition
date_struct.hpp:16
MQL5
Include
time_shield
date_struct.mqh
Generated by
1.17.0