I have to define a date in my Student Object,like that:
var Students = new List<Student>
{
new Student{ FirstName="Student ",dateBirth=DateTime.Today }
};
Students.ForEach(s =>
{
s.ObjectState = Repository.Pattern.Infrastructure.ObjectState.Added;
context.Students.Add(s);
context.SaveChanges();
});
but I get this format when I run my project:
[{ FirstName: "Student ", dateBirth: "/Date(1457132400000)/" }]
the problem is that the date format is added exactly to the DataBase Student Table (like yyyy-MM-dd hh:mm:ss
). I work with xampp MySQL
any idea please how can I solve this problem,and display the date correctly?