Time Shield Library
C++ library for working with time
Toggle main menu visibility
Loading...
Searching...
No Matches
date_time_struct.mqh
Go to the documentation of this file.
1
//+------------------------------------------------------------------+
2
//| date_time_struct.mqh |
3
//| Time Shield - MQL5 DateTime Structure |
4
//| Copyright 2025, NewYaroslav |
5
//| https://github.com/NewYaroslav/time-shield-cpp |
6
//+------------------------------------------------------------------+
7
#ifndef TIME_SHIELD_MQL5_HEADER_TIME_SHIELD_DATE_TIME_STRUCT_MQH_INCLUDED
8
#define TIME_SHIELD_MQL5_HEADER_TIME_SHIELD_DATE_TIME_STRUCT_MQH_INCLUDED
9
17
18
#property copyright "Copyright 2025, NewYaroslav"
19
#property link "https://github.com/NewYaroslav/time-shield-cpp"
20
#property strict
21
22
namespace
time_shield
{
23
26
struct
DateTimeStruct
{
27
long
year
;
28
int
mon
;
29
int
day
;
30
int
hour
;
31
int
min
;
32
int
sec
;
33
int
ms
;
34
};
35
46
DateTimeStruct
create_date_time_struct
(
47
const
long
year
,
48
const
int
mon = 1,
49
const
int
day = 1,
50
const
int
hour = 0,
51
const
int
min = 0,
52
const
int
sec = 0,
53
const
int
ms = 0) {
54
DateTimeStruct
result;
55
result.year =
year
;
56
result.mon = mon;
57
result.day = day;
58
result.hour = hour;
59
result.min = min;
60
result.sec = sec;
61
result.ms = ms;
62
return
result;
63
}
64
65
};
// namespace time_shield
66
67
#endif
// TIME_SHIELD_MQL5_HEADER_TIME_SHIELD_DATE_TIME_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_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
MQL5
Include
time_shield
date_time_struct.mqh
Generated by
1.17.0