tags:

views:

684

answers:

1

I think my brain has just quit on me due to the late hour. Can anyone tell me the best way to translate a javascript getTime() value to a C# DateTime value,

I have an ajax component which sends the JS time value as a parameter to ASP.NET mvc controller which will then return some Json objects.

Thanks for your help.

I do know that the JS time value is the milliseconds passed since Jan 1st 1970.

+6  A: 
new DateTime(1970, 01, 01).AddMilliseconds(jsGetTimeValue);
Matthew Brindley
Thanks for this. And yes, I did feel quite stupid when I realised the solution. Too many late nights!
Richard