Wednesday, September 9, 2009

Format Date

        public static string FormatDate(object date, string format)

        {

            string formattedDate = string.Empty;

 

            if (date != null && Utility.IsDate(date.ToString()))

            {

                formattedDate = Convert.ToDateTime(date).ToString(format);

            }

 

            return formattedDate;

        }

No comments: