I have a function in Javascript that receives a C# DateTime from MVC. If the date is null it should return \"-\", if it\'s a valid date it should return the formated date.
I use the following to pass a Javascript Date into C#:
var now = new Date();
var date = (now.getTime() / 86400000) - (now.getTimezoneOffset() / 1440) + 25569;
So if you get the number of milliseconds from C#, it should be something like this:
var csharpmilliseconds;
var now = new Date();
var date = new Date((csharpmilliseconds + (now.getTimezoneOffset() / 1440) - 25569) * 86400000);