public static DateTime ValueToDate(long dateValue) { if ((dateValue < 0L) || (dateValue > 0xffffffffUL)) { throw new ArgumentOutOfRangeException(); } return(PlcOpenDateConverterBase.ToDateTime((uint)dateValue)); }
public static bool TryParse(string s, out TOD tod) { uint num; TimeSpan span; if (TryParseToTicks(s, out num)) { tod = new TOD(num); return(true); } if (PlcOpenDateConverterBase.TryParseTimeSpan(s, out span)) { tod = new TOD(span); return(true); } tod = null; return(false); }
public static bool TryParse(string s, out TIME time) { TimeSpan span; uint milliseconds = 0; if (TryParseToMilliseconds(s, out milliseconds)) { time = new TIME(milliseconds); return(true); } if (PlcOpenDateConverterBase.TryParseTimeSpan(s, out span)) { time = new TIME(span); return(true); } time = null; return(false); }
public static bool TryParse(string s, out LTIME time) { TimeSpan span; ulong nanoseconds = 0UL; if (TryParseToNanoseconds(s, out nanoseconds)) { time = new LTIME(nanoseconds); return(true); } if (PlcOpenDateConverterBase.TryParseTimeSpan(s, out span)) { time = new LTIME(span); return(true); } time = null; return(false); }
public static DateTime ValueToDate(uint dateValue) => PlcOpenDateConverterBase.ToDateTime(dateValue);
public static long DateToValue(DateTime date) => ((long)PlcOpenDateConverterBase.ToTicks(date));