You can use the [DisplayFormat] on your model, for example:
public class Person
{
public int ID { get; set; }
public string Name { get; set; }
[DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}")] // Change the format as of how u require..
public DateTime Birthday { get; set; }
}
kirupa.v
Contributor
2070 Points
531 Posts
Re: Date time format
Apr 10, 2012 06:12 AM|LINK
You can use the [DisplayFormat] on your model, for example:
public class Person { public int ID { get; set; } public string Name { get; set; } [DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}")] // Change the format as of how u require.. public DateTime Birthday { get; set; } }</div>