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

222
Views
In Javascript how to avoid conversion of date in native Date Object

I need to save different date formats in ISO format but with out converting in native javascript date object (i.e. new Date()). I don't want to change the date values, just saving at it is but in a common foramt. I can't predict the date format, because it will coming from different RSS feeds

Example for formats :

var d1 = '2021-09-07T12:00:00+09:00';
var d2 = 'Thu, 09 Sep 2021 01:00:00 +1000';
var d3 = 'Thu, 09 Sep 2021 04:00:00 GMT';
var d4 = 'Thu, 09 Sep 2021 16:25:41 EDT';
var d5 = '2021-Sept-07';
var d6 = '09-09-2021';

console.log(new Date(d1).toISOString().slice(0, -5));
console.log(new Date(d2).toISOString().slice(0, -5));
console.log(new Date(d3).toISOString().slice(0, -5));
console.log(new Date(d4).toISOString().slice(0, -5));
console.log(new Date(d5).toISOString().slice(0, -5));
console.log(new Date(d6).toISOString().slice(0, -5));

2021-09-07T03:00:00
2021-09-08T15:00:00 // Date Change
2021-09-09T04:00:00
2021-09-09T20:25:41
2021-09-06T18:30:00 // Date Change
2021-09-08T18:30:00 // Date Change
about 4 years ago · Juan Pablo Isaza
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!