public static DateTime GetDateTime(MiMFa_Time time) { DateTime dt = new DateTime(); dt = new DateTime(dt.Year, dt.Month, dt.Day, time.Hour, time.Minute, time.Second); return(dt); }
public static MiMFa_Time operator -(MiMFa_Time op1, MiMFa_Time op2) { var op = new MiMFa_Time(op1); op.DecreaseWith(op2); return(op); }
public static MiMFa_Time operator /(MiMFa_Time op1, MiMFa_Time op2) { var op = new MiMFa_Time(op1); op.Hour /= op1.Hour; op.Minute /= op1.Minute; op.Second /= op1.Second; return(op); }
public static void Decrease(MiMFa_Time thisTime, params MiMFa_Time[] withThisTimes) { foreach (var item in withThisTimes) { thisTime.ULHour -= item._Hour; thisTime.ULMinute -= item._Minute; thisTime.ULSecond -= item._Second; } }
public static bool Compare(MiMFa_Time thisTime, MiMFa_Time rhitThisTime) { if (rhitThisTime._Hour == thisTime._Hour && rhitThisTime._Minute == thisTime._Minute && rhitThisTime._Second == thisTime._Second) { return(true); } return(false); }
public static bool IsBetween(MiMFa_Time thisTime, MiMFa_Time fromthisTime, MiMFa_Time tothisTime) { if (IsSame(thisTime, fromthisTime) || IsSame(thisTime, tothisTime) || (IsNext(thisTime, fromthisTime) && IsBack(thisTime, tothisTime))) { return(true); } return(false); }
public static MiMFa_Time GetLengthTime(MiMFa_Time ofThisTime, MiMFa_Time toThisTime) { float Len = GetLengthSecond(ofThisTime, toThisTime); int h = (int)Len / 3600; int m = (int)(Len % 3600) / 60; int s = (int)(Len % 3600) % 60; MiMFa_Time time = new MiMFa_Time(); time._Hour = h; time._Minute = m; time._Second = s; return(time); }
public static float GetLengthSecond(MiMFa_Time ofThisTime, MiMFa_Time toThisTime) { int sec = 0; if (ofThisTime.Hour >= toThisTime.Hour && ofThisTime.Minute >= toThisTime.Minute && ofThisTime.Second >= toThisTime.Second) { sec += (24 - (ofThisTime.Hour - toThisTime.Hour)) * 3600; } else { sec += ((toThisTime.Hour - ofThisTime.Hour) * 3600); } sec += ((toThisTime.Minute - ofThisTime.Minute) * 60); sec += toThisTime.Second - ofThisTime.Second; return(sec); }
public static bool IsNext(MiMFa_Time thisTime, MiMFa_Time fromthisTime) { if (ReferenceEquals(thisTime, null) || ReferenceEquals(fromthisTime, null)) { return(false); } if (thisTime.Hour > fromthisTime.Hour) { return(true); } if (thisTime.Hour == fromthisTime.Hour && thisTime.Minute > fromthisTime.Minute) { return(true); } if (thisTime.Hour == fromthisTime.Hour && thisTime.Minute == fromthisTime.Minute && thisTime.Second > fromthisTime.Second) { return(true); } return(false); }
public static float GetLengthMinute(MiMFa_Time ofThisTime, MiMFa_Time toThisTime) { return(GetLengthSecond(ofThisTime, toThisTime) / 60); }
public float GetLengthMinute(MiMFa_Time toThisTime) { return(GetLengthMinute(this, toThisTime)); }
public static float GetLengthHour(MiMFa_Time ofThisTime, MiMFa_Time toThisTime) { return(GetLengthSecond(ofThisTime, toThisTime) / 3600); }
public float GetLengthHour(MiMFa_Time toThisTime) { return(GetLengthHour(this, toThisTime)); }
public void SetTime(MiMFa_Time time) { SetTime(time.Hour, time.Minute, time.Second); }
public MiMFa_Time GetLengthTime(MiMFa_Time toThisTime) { return(GetLengthTime(this, toThisTime)); }
public static void CopyTo(MiMFa_Time ofThisTime, MiMFa_Time toThisTime) { toThisTime._Hour = ofThisTime._Hour; toThisTime._Minute = ofThisTime._Minute; toThisTime._Second = ofThisTime._Second; }
public bool IsNext(MiMFa_Time fromthisTime) { return(IsNext(this, fromthisTime)); }
public bool IsBack(MiMFa_Time fromthisTime) { return(IsBack(this, fromthisTime)); }
public static string GetTime(MiMFa_Time time) { return(string.Format("{0:d2}:{1:d2}:{2:d2}", time.Hour, time.Minute, time.Second)); }
public void CopyTo(MiMFa_Time thisTime) { CopyTo(this, thisTime); }
public static bool IsSame(MiMFa_Time thisTime, MiMFa_Time rhitthisTime) { return(rhitthisTime._Hour == thisTime._Hour && rhitthisTime._Minute == thisTime._Minute && rhitthisTime._Second == thisTime._Second); }
public bool IsSame(MiMFa_Time thisTime) { return(IsSame(this, thisTime)); }
public float GetLengthSecond(MiMFa_Time toThisTime) { return(GetLengthSecond(this, toThisTime)); }
public bool IsBetween(MiMFa_Time fromthisTime, MiMFa_Time tothisTime) { return(IsBetween(this, fromthisTime, tothisTime)); }
public bool Compare(MiMFa_Time thisTime) { return(Compare(this, thisTime)); }