P
P
pavelkunyavskiy2018-02-10 20:45:27
JavaScript
pavelkunyavskiy, 2018-02-10 20:45:27

How to format the time in this way?

There is data of the form 2018-02-09T11:29:38.407Z
How to get an output like: 7 hours ago, 3 days ago, a week ago?
Is there such formatting in native JS, or is the use of third-party modules still necessary?
Also, how to do the same, only with internationalization, i.e. like 7 часов назад, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2018-02-10
@pavelkunyavskiy

you can of course natively, but if there are no special prejudices - momentjs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question