Why date format changes for web application deployed on Azure ?(ASP .NET Core)

Viewed 1065
2 Answers

If you use .ToString method of DateTime class you can specify the formate. Example dateObject.ToString("dd/MMM/yyyy")

Create two model values:

 public string date { get; set; }
 public string time { get; set; }

and this function:

public void DateandTimeofCalculation() {
    model.date = @DateTime.Now.ToString("dd/MM/yyyy");
    model.time = @DateTime.Now.ToString("HH:mm");

}

So you can manipulate both date and time formats on both the development and Azure environment

Related