mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-22 07:08:16 +00:00
Issue #100: implemented second function SymbolInfoString (MT5)
This commit is contained in:
@@ -16,12 +16,13 @@ namespace MtApi5
|
||||
return new DateTime(tmpTime.Ticks + (time * 0x989680L));
|
||||
}
|
||||
|
||||
public static int ConvertToMtTime(DateTime time)
|
||||
public static int ConvertToMtTime(DateTime? time)
|
||||
{
|
||||
var result = 0;
|
||||
if (time == DateTime.MinValue) return result;
|
||||
if (time == null || time == DateTime.MinValue)
|
||||
return result;
|
||||
var tmpTime = new DateTime(1970, 1, 1);
|
||||
result = (int)((time.Ticks - tmpTime.Ticks) / 0x989680L);
|
||||
result = (int)((time.Value.Ticks - tmpTime.Ticks) / 0x989680L);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user