Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to translate javascript getTime() value to C# DateTime

Tags:

javascript

c#

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.

like image 245
Richard Avatar asked May 31 '09 00:05

Richard


1 Answers

new DateTime(1970, 01, 01).AddMilliseconds(jsGetTimeValue);
like image 119
Matt Brindley Avatar answered Oct 13 '22 16:10

Matt Brindley