Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
time_struct.mqh
Go to the documentation of this file.
1//+------------------------------------------------------------------+
2//| time_struct.mqh |
3//| Time Shield - MQL5 Time Structure |
4//| Copyright 2025, NewYaroslav |
5//| https://github.com/NewYaroslav/time-shield-cpp |
6//+------------------------------------------------------------------+
7#ifndef __TIME_SHIELD_TIME_STRUCT_MQH__
8#define __TIME_SHIELD_TIME_STRUCT_MQH__
9
17
18#property copyright "Copyright 2025, NewYaroslav"
19#property link "https://github.com/NewYaroslav/time-shield-cpp"
20#property strict
21
22namespace time_shield {
23
26 struct TimeStruct {
27 int hour;
28 int min;
29 int sec;
30 int ms;
31 };
32
41 const int hour,
42 const int min,
43 const int sec = 0,
44 const int ms = 0) {
45 TimeStruct result;
46 result.hour = hour;
47 result.min = min;
48 result.sec = sec;
49 result.ms = ms;
50 return result;
51 }
52
53}; // namespace time_shield
54
55#endif // __TIME_SHIELD_TIME_STRUCT_MQH__
const TimeStruct create_time_struct(int16_t hour, int16_t min, int16_t sec=0, int16_t ms=0)
Creates a TimeStruct instance.
Main namespace for the Time Shield library.
Structure to represent time.
int16_t ms
Millisecond component of time (0-999)
int16_t hour
Hour component of time (0-23)
int16_t sec
Second component of time (0-59)
int16_t min
Minute component of time (0-59)