Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

149
Views
How to convert Date().toLocaleString() to YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]

I am trying to make an axios post request to django datetimefield, it requires the datetime format of YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]. I am currently getting the format Sun May 29 2022 02:42:00 GMT+0800 (香港標準時間) from Date().toLocaleString() in reactjs. The (香港標準時間) means Hong Kong Time.

Anybody has an idea on converting the date format in Reactjs? Much thanks.

8 months ago · Juan Pablo Isaza
Answer question
Find remote jobs