Time Shield Library
C++ library for working with time
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_DATE_STRUCT_MQH__
8#define __TIME_SHIELD_DATE_STRUCT_MQH__
9
16
17#property copyright "Copyright 2025, NewYaroslav"
18#property link "https://github.com/NewYaroslav/time-shield-cpp"
19#property strict
20
21namespace 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_DATE_STRUCT_MQH__
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.