Argentini.Halide.H3Temporal.TimeFormat C# (CSharp) Method

TimeFormat() public static method

Format a time of day for output.
public static TimeFormat ( System date, TimeFormats format ) : String
date System Time variable to format.
format TimeFormats Time format.
return String
        public static String TimeFormat(System.DateTime date, TimeFormats format)
        {
            string thedate = string.Empty;

            try
            {
                switch (format)
                {
                    case TimeFormats.Standard:
                        thedate = date.ToString("h:mmtt");
                        break;
                    case TimeFormats.SqlMilitary:
                        thedate = date.ToString("HH:mm:ss");
                        break;
                    case TimeFormats.Military:
                        thedate = date.ToString("HH:mm");
                        break;
                    default:
                        thedate = date.ToString("h:mmtt");
                        break;
                }
            }
            catch
            {}
            return (thedate);
        }

Same methods

H3Temporal::TimeFormat ( string date, TimeFormats format ) : String