Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
How to convert date into timestamp with javascript

I have a date in YYYY-MM-DD format and I want to convert it into a timestamp like 1645985084088 using javascript. Can someone help me out?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Using .getTime() you can covert a Date object to a timestamp in JavaScript:

let date = new Date("02-03-2022");
console.log(date.getTime());

about 4 years ago · Juan Pablo Isaza Report

0

To ensure consistency regardless of the timezone of the user:

let date = '2022-03-02';
new Date(date + 'T00:00Z').getTime();

This will give the UTC timestamp for midnight at the start of the given date.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!