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

173
Views
Javascript Date String Manipulation

I have a date objectdata = '2021-07-30T22:33:38.000Z' . I need to manipulate the string a bit, for example create a string like 'abc2021-07-30T22:33:38.000Z. If I use 'abc'+data, the result would become abcFri Jul 30 2021 15:33:38 GMT-0700 (Pacific Daylight Time)

is there a way to convert data object to a string type without changing the format?

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

0

You can use "abc" + data.toISOString(). By default, turning a Date instance into a string gets you a string in the form you've seen, but there are various ways of getting other formats.

about 4 years ago · Juan Pablo Isaza Report

0

The toString() method converts a Date object to a string.

Note: This method is automatically called by JavaScript whenever a Date object needs to be displayed as a string.

 var d = new Date();
 console.log(d.toString())

more on this topic

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!