Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
while running my project in MVC-4 getting date time format like /Date(1426530600000)/

How to resolve this error
Thanks
Posted
Comments
[no name] 9-Sep-15 3:50am    
Try to add Serializable in datetime variable.
public class Birthdays
{
[Serializable]
public DateTime DateOfBirth {get;set;}
}
Er. Anil Kumar 9-Sep-15 7:03am    
No change

1 solution

Hi Anil,

How do you written you code and where do you formatting your date its depend
you can set your date format by annotation

C#
[Display(Name = "Release Date")]
[DataType(DataType.Date), DisplayFormat( DataFormatString="{0:dd/MM/yyyy}", ApplyFormatInEditMode=true )]
public Nullable<datetime> release_date { get; set; }
</datetime>


Please search on google for more on culture and globalization settings.
I hope your code will work if any extra question feel free put comments.

With Regards,
Manoj
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900