This commit is contained in:
2024-10-20 20:27:51 +03:30
parent b86e8d5c6b
commit 63fbb72cd1
2 changed files with 137 additions and 119 deletions
+41
View File
@@ -7976,6 +7976,47 @@ ulong GetCurrentTimeAsMilliSeconds()
return result;
}
//
// Retrieve only Hour and Minute as String ...
string GetTimeString(
datetime time = NULL
)
{
//
NormalizeTime(time);
//
string result = NULL;
//
MqlDateTime tStruct;
bool isStructed = TimeToStruct(time, tStruct);
if (!isStructed)
{
return result;
}
//
string hour = ToString(tStruct.hour);
hour =
StringLen(hour) == 1
? "0" + hour
: hour;
//
string minute = ToString(tStruct.min);
minute =
StringLen(minute) == 1
? "0" + minute
: minute;
//
result = hour + ":" + minute;
//
return result;
}
//
// Converts a Date time to File Format ...
string ToFormatString(