Sunday, November 16, 2014

Method for format date

  /// <summary>
        /// No need to use this.
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static DateTime FormatDate(string date)
        {
            DateTimeFormatInfo dateFormat = new DateTimeFormatInfo();
            dateFormat.ShortDatePattern = "dd/MM/yyyy";
            return Convert.ToDateTime(date, dateFormat);
        }

No comments:

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...