private DateTime FileTimeToDate(ref CIEPasswords.FILETIME ftDateTime) { CIEPasswords.FileTimeToLocalFileTime(ref ftDateTime, ref this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lft); CIEPasswords.FileTimeToSystemTime(ref this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lft, ref this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst); return(DateTime.FromOADate(DateAndTime.DateSerial((int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wYear, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wMonth, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wDay).ToOADate() + DateAndTime.TimeSerial((int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wHour, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wMinute, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wSecond).ToOADate())); }
public static DateTime TimeSerial(int Hour, int Minute, int Second) { return(DateAndTime.TimeSerial(Hour, Minute, Second)); }
public decimal MakeJulDate(short vintDay, short vintMonth, short vintYear, short nvintHour = 0, short nvintMinute = 0, short nvintSecond = 0, short nvintMilliSec = 0) { string dstrRefString = Support.Format(vintDay, "00\\.") + Support.Format(vintMonth, "00\\.") + Support.Format(vintYear, "0000\\ ") + Support.Format(nvintHour, "00\\:") + Support.Format(nvintMinute, "00\\:") + Support.Format(nvintSecond, "00"); string dstrInpString = Conversions.ToString(DateTime.FromOADate(DateAndTime.DateSerial(vintYear, vintMonth, vintDay).ToOADate() + DateAndTime.TimeSerial(nvintHour, nvintMinute, nvintSecond).ToOADate())); if (Operators.CompareString(Support.Format(dstrInpString, "dd\\.mm\\.yyyy\\ hh\\:nn\\:ss"), dstrRefString, TextCompare: false) != 0) { Information.Err().Raise(50000, "UtilTime", "Der Datumswert ist ungültig."); } else { if (!(nvintMilliSec < 0 || nvintMilliSec > 999)) { JULDATE_LONG dtypJulDateLng = default(JULDATE_LONG); dtypJulDateLng.jdDays = InternGetJulDays(vintDay, vintMonth, vintYear); dtypJulDateLng.jdTime = InternCalcJulTime(nvintHour, nvintMinute, nvintSecond, nvintMilliSec); JULDATE_CURRENCY dtypJulDateCur = InternJulDatLngToJulDateCur(dtypJulDateLng); return(dtypJulDateCur.jdCompl); } Information.Err().Raise(50000, "UtilTime", "Millisekunden außerhalb des Gültigkeitsbereiches."); } decimal MakeJulDate = default(decimal); return(MakeJulDate); }
public static object TimeSerial(object hour, object minute, object second) { return(DateAndTime.TimeSerial(Convert.ToInt32(hour), Convert.ToInt32(minute), Convert.ToInt32(second))); }
public DateTime JulDateToDate(decimal vcurJulDate) { if (!IsJulDate(vcurJulDate)) { Information.Err().Raise(50000, "UtilTime", "Das Datum ist ungültig."); } else { JULDATE_LONG dtypJulDateLng = InternGetJulSplit(vcurJulDate); int dlngTime = dtypJulDateLng.jdTime; DateTime ddatTemp = DateTime.FromOADate(InternGetGregDate(dtypJulDateLng.jdDays).ToOADate() + DateAndTime.TimeSerial(InternTimeToHours(dlngTime), InternTimeToMinutes(dlngTime), InternTimeToSeconds(dlngTime)).ToOADate()); DateTime t = ddatTemp; if (DateTime.Compare(t, new DateTime(499230432000000000L)) < 0) { Information.Err().Raise(50000, "UtilTime", "Das Ergebnis liefert ein Datum, das vor dem Gültigkeitsbereich liegt."); } else { if (DateTime.Compare(t, new DateTime(693937151990000000L)) <= 0) { return(ddatTemp); } Information.Err().Raise(50000, "UtilTime", "Das Ergebnis liefert ein Datum, das nach dem Gültigkeitsbereich liegt."); } } DateTime JulDateToDate = default(DateTime); return(JulDateToDate); }