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

280
Views
Format time to new Date() format of JS

I have a time, as string "13:00:00". I need to convert it so that my date picker component gets the value in proper format because it accepts only a Date object like below:

<DatePicker
  mode="time"
  locale="en_GB" // Use "en_GB" here
  date={new Date()}
/>

How to format the time string "13:00:00" or any other in the format HH:mm:ss, so that i can directly supply it to the date picker component.

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

0

I was able to solve the problem by using @YevgenGorbunkov 's solution

date = {new Date().setHours(...'13:00:00'.split(':'))}
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!