Tuesday, April 28, 2009

DateTime Convertion in 24 Hour Format

private string dateConvert(string datDate){
System.Globalization.CultureInfo cultEnGb = new System.Globalization.CultureInfo("en-GB");
System.Globalization.CultureInfo cultEnUs = new System.Globalization.CultureInfo("en-US");
DateTime dtGb = Convert.ToDateTime(datDate, cultEnGb.DateTimeFormat); datDate = dtGb.ToString(cultEnUs.DateTimeFormat.ShortDatePattern);
return datDate;}

No comments:

Using Authorization with Swagger in ASP.NET Core

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