below is purchase class,which contain property as orderdate with type datetime
public class Purchase
{
public int Id { get; set; }
public string OrderNo { get; set; }
public DateTime OrderDate { get; set; }
public string Location { get; set; }
}
when i create object of purchase i want to assign date to it.and for output i want to show format as "dd-MMM-yy" eg. 27-May-14
i tried purchase.OrderDate = Convert.ToDateTime("27-May-13");
but it shows result as
5/27/2013 12:00:00 AM