示例#1
0
        private static string formatTime(DateTime dateValue, string format)
        {
            string timeFormatted = "";
            if (dateValue != null)
            {
                timeFormatted = dateValue.Format(format);

            }
            return timeFormatted;
        }
示例#2
0
 public static string FormatTimeSpecific(DateTime dateValue, string formatString)
 {
     formatString = formatString.Replace(".", ":").Replace("-", ":").Replace(",", ":");
     if (dateValue != null && (typeof(DateTime) == dateValue.GetType()))
     {
         return(dateValue.Format(formatString));
     }
     else
     {
         return("");
     }
 }