Javascript date format to match rails formats

I get the date back from the rails, which looks like this: "2010-10-29T00: 00: 00 + 00: 00"

And I would like to convert the javascript date created by 'new Date ()' to this format. Is there an easy way?

+3
source share
3 answers

You are looking for the ISO 8601 format.

I always liked Date.js Library for any date processing / formatting in JS.

you can use toISOString () method to get this format

+4
source

, ISO8601. google dansnetwork.com, , ISO8601 Date. ( String.split() Date api.). , , -, Mozilla Javascript 1.8.5 ISO8601 parse(). , .

0

Source: https://habr.com/ru/post/1770792/


All Articles