public static TdrError.ErrorType tdrTime2Str(ref TdrVisualBuf buf, UInt32 time) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; TdrTime tm = new TdrTime(); ret = tm.parse(time); if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0:d2}:{1:d2}:{2:d2}", tm.nHour, tm.bMin, tm.bSec); } else { #if (DEBUG) StackTrace st = new StackTrace(true); for (int i = 0; i < st.FrameCount; i++) { if (null != st.GetFrame(i).GetFileName()) { Console.WriteLine(st.GetFrame(i).ToString()); } } #endif ret = TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE; } return(ret); }
public static TdrError.ErrorType str2TdrTime(out UInt32 time, string strTime) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; DateTime dt; TdrTime tdrTime = new TdrTime(); if (DateTime.TryParse(strTime, out dt)) { tdrTime.nHour = (short)dt.TimeOfDay.Hours; tdrTime.bMin = (byte)dt.TimeOfDay.Minutes; tdrTime.bSec = (byte)dt.TimeOfDay.Seconds; tdrTime.toTime(out time); } else { #if (DEBUG) StackTrace st = new StackTrace(true); for (int i = 0; i < st.FrameCount; i++) { if (null != st.GetFrame(i).GetFileName()) { Console.WriteLine(st.GetFrame(i).ToString()); } } #endif time = 0; ret = TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE; } return(ret); }
public static TdrError.ErrorType tdrTime2Str(ref TdrVisualBuf buf, uint time) { TdrTime time2 = new TdrTime(); if (time2.parse(time) == TdrError.ErrorType.TDR_NO_ERROR) { object[] args = new object[] { time2.nHour, time2.bMin, time2.bSec }; return(buf.sprintf("{0:d2}:{1:d2}:{2:d2}", args)); } return(TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE); }
public static TdrError.ErrorType str2TdrTime(out uint time, string strTime) { DateTime time2; TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; TdrTime time3 = new TdrTime(); if (DateTime.TryParse(strTime, out time2)) { time3.nHour = (short)time2.TimeOfDay.Hours; time3.bMin = (byte)time2.TimeOfDay.Minutes; time3.bSec = (byte)time2.TimeOfDay.Seconds; time3.toTime(out time); return(type); } time = 0; return(TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE); }
public static TdrError.ErrorType tdrTime2Str(ref TdrVisualBuf buf, uint time) { TdrTime tdrTime = new TdrTime(); TdrError.ErrorType result; if (tdrTime.parse(time) == TdrError.ErrorType.TDR_NO_ERROR) { result = buf.sprintf("{0:d2}:{1:d2}:{2:d2}", new object[] { tdrTime.nHour, tdrTime.bMin, tdrTime.bSec }); } else { result = TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE; } return(result); }
public static TdrError.ErrorType str2TdrTime(out uint time, string strTime) { TdrError.ErrorType result = TdrError.ErrorType.TDR_NO_ERROR; TdrTime tdrTime = new TdrTime(); DateTime dateTime; if (DateTime.TryParse(strTime, ref dateTime)) { tdrTime.nHour = (short)dateTime.get_TimeOfDay().get_Hours(); tdrTime.bMin = (byte)dateTime.get_TimeOfDay().get_Minutes(); tdrTime.bSec = (byte)dateTime.get_TimeOfDay().get_Seconds(); tdrTime.toTime(out time); } else { time = 0u; result = TdrError.ErrorType.TDR_ERR_INVALID_TDRTIME_VALUE; } return(result); }
public TdrDateTime(ulong datetime) { tdrDate = new TdrDate((uint)(datetime & 0xFFFFFFFF)); tdrTime = new TdrTime((uint)((datetime >> 32) & 0xFFFFFFFF)); }
public TdrDateTime() { tdrDate = new TdrDate(); tdrTime = new TdrTime(); }
public TdrDateTime(ulong datetime) { this.tdrDate = new TdrDate((uint)(datetime & (ulong)-1)); this.tdrTime = new TdrTime((uint)(datetime >> 32 & (ulong)-1)); }
public TdrDateTime() { this.tdrDate = new TdrDate(); this.tdrTime = new TdrTime(); }
public TdrDateTime(ulong datetime) { this.tdrDate = new TdrDate((uint)(datetime & 0xffffffffL)); this.tdrTime = new TdrTime((uint)((datetime >> 0x20) & 0xffffffffL)); }