public static string GetText(ETimeFormatType type) { if (type == ETimeFormatType.ShortTime) { return("8:09"); } if (type == ETimeFormatType.LongTime) { return("8:09:24"); } throw new Exception(); }
public static string GetValue(ETimeFormatType type) { if (type == ETimeFormatType.ShortTime) { return("ShortTime"); } if (type == ETimeFormatType.LongTime) { return("LongTime"); } throw new Exception(); }
public static bool Equals(ETimeFormatType type, string typeStr) { if (string.IsNullOrEmpty(typeStr)) { return(false); } if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower())) { return(true); } return(false); }
public static string GetTimeString(DateTime datetime, ETimeFormatType timeFormat) { var retval = string.Empty; if (timeFormat == ETimeFormatType.LongTime) { retval = datetime.ToLongTimeString(); } else if (timeFormat == ETimeFormatType.ShortTime) { retval = datetime.ToShortTimeString(); } return(retval); }
public static string GetText(ETimeFormatType type) { if (type == ETimeFormatType.ShortTime) { return "8:09"; } else if (type == ETimeFormatType.LongTime) { return "8:09:24"; } else { throw new Exception(); } }
public static string GetValue(ETimeFormatType type) { if (type == ETimeFormatType.ShortTime) { return "ShortTime"; } else if (type == ETimeFormatType.LongTime) { return "LongTime"; } else { throw new Exception(); } }
public static bool Equals(string typeStr, ETimeFormatType type) { return(Equals(type, typeStr)); }
public static string GetDateAndTimeString(DateTime datetime, EDateFormatType dateFormat, ETimeFormatType timeFormat) { return($"{GetDateString(datetime, dateFormat)} {GetTimeString(datetime, timeFormat)}"); }