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

134
Views
How to convert time from English to French format using JavaScript

I want to convert this:

04/01/2021 02:06:22 PM

to:

04/01/2021 14:06:22

I tried many things but not success, thank you for your help

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

0

Use the toLocaleString() method to change time formatting to 24 hours, e.g. date.toLocaleString('en-US', {hour12: false}). The toLocaleString method returns a string that represents the date and time according to the provided locale and options parameters.

const date = new Date();

console.log(
  date.toLocaleString('en-US', {
    hour12: false,
  }),
);

about 4 years ago · Juan Pablo Isaza Report

0

try this:

date.toLocaleString("fr");
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!