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

155
Views
Display time from string timestamp in javascript

I am trying to display the date from time stamp using JavaScript but not working please check my code and it's not working due to string time but if i passed in number then it's working but this time coming from API so i must need to do something here. can anyone please help me.

var timestamp = '1607110465663'
var date = new Date(timestamp);
console.log(date.getTime())
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

You can convert string to number using methods such as Number or parseInt before creating Date object.

e.g.

var timestamp = '1607110465663'
var date = new Date(Number(timestamp));
console.log(date.getTime())
about 4 years ago · Juan Pablo Isaza Report

0

Parse string into int then...:

var timestamp = '1607110465663'
var date = new Date(parseInt(timestamp));

and use date object

console.log(date)
about 4 years ago · Juan Pablo Isaza Report

0

Remove the '' from timestamp

var timestamp = 1607110465663
var date = new Date(timestamp);
console.log(date.getTime())
console.log(date)

See JSfiddle

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!