Click here to Skip to main content
15,663,727 members

Comments by zeeShan anSari (Top 8 by date)

zeeShan anSari 19-Apr-21 12:37pm View    
My input is 637532118000166280 and your suggested formula is return 2021-04-05 05:30:00.016000 but I need 2021-04-05 09:30:00.016628. Actual code:
// NB a tick is commonly 100 nanoseconds
var epoch = 621355968000000000; // ticks up to Jan 1 1970
var tdate = data; // the date in ticks
var dt = tdate - epoch; // rebase to Jan 1 1970
var millisec = dt/10000; // convert to milliseconds
var d = new Date(millisec); // create a Javascript Date object

return moment(d).format("YYYY-MM-DD hh:mm:ss.SSSSSS");

Thanks for your quick response.
zeeShan anSari 19-Apr-21 11:56am View    
It converts up to 3 precision but I need up to 6 precision. What should I do.
zeeShan anSari 31-Mar-21 18:01pm View    
Nice explanation...Its work. thanks!
zeeShan anSari 1-Apr-14 11:07am View    
oK...but i want pass json data and it can be huge data. For example I want pass grid data to server side.
I can fix this issue by change in angular.js and where replace the {"d":null} and it is working!

zeeShan anSari 3-Feb-14 15:57pm View    
My method is working on page but I want use this method from razor/cshtml page.