Answer the question
In order to leave comments, you need to log in
How to format date for time zone?
Date/time is sent from the server in YYYY-MM-DD HH:MM:SS format and time zone (Etc/GMT, Europe/Moscow).
If there are any libraries to convert this to custom time in an arbitrary format?
Answer the question
In order to leave comments, you need to log in
Question on stackoverflow .
There are also libraries.
If you look in the direction of jQuery, then jQuery dateFormat .
If you need a datepicker - $.datepicker.formatDate .
jacwright.com/projects/javascript/date_format/
var dateFromServer = '2012-06-04 15:55:55',
d = Date.parse(dateFromServer),
result = (new Date(d)).format('d.m.Y H:i');
console.log(result)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question