Convert DateTime to Ticks Javascript or Jquery

Can someone please suggest how to convert date like below to ticks
May 09 2019 23:59:59 to ticks in jquery or javascript?

Correct ticks conversion value should be :


As per this link:

Abhilash Nagar.NET DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It should be sum of ticks since the epoch and ticks between 1st Jan 0001 and 1st Jan 1970.

var ticks = ((yourDateObject.getTime() * 10000) + 621355968000000000);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
var TICK_CONSTANT = 621355968000000000;
var dateStr = 'May 09 2019 23:59:59';
var date = new Date(dateStr);
var ticks = ((date.getTime() * 10000) + TICK_CONSTANT);

Open in new window

Abhilash Nagar.NET DeveloperAuthor Commented:
Thanks for the response. Yes your solution is correct but to match it exactly to .NET  i did this :

((yourDateObject.getTime() * 10000) + 621355968000000000)-(yourDateObject.getTimezoneOffset() * 600000000);

Below link :
Julian HansenCommented:
Great - suggestion - next time mention you need a TimeZone offset and we will include it in the solution - but glad you are working.
Abhilash Nagar.NET DeveloperAuthor Commented:
Thanks for all responses, great help!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.