A
A
Anton Medvedev2012-06-04 15:43:22
JavaScript
Anton Medvedev, 2012-06-04 15:43:22

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

3 answer(s)
F
freeek, 2012-06-04
@Elfet

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 .

V
Vitaliy Petrychuk, 2012-06-04
@vermilion1

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)

K
Keyten, 2012-06-04
@Keyten

There is Sugar.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question