Parsing Date from database in javascript -


this can small problem getting confused how understand date format stored in database.

in mysql database have date stored 2014-12-02t01:15:00z

now looks me 01:15:00

but on javascript coming 12:15pm

m = moment('2014-12-02t01:15:00z') m.format('yyyy-mm-dd hh:mm a') "2014-15-02 12:15 pm" 

i want know how 01:15 becomes 12:15pm may missing basic bit not find it

the time based on computer believe. conversion.

for instance:

var t = '2014-12-02t01:15:00z'; console.log(new date(t)); 

then get:

mon dec 01 2014 17:15:00 gmt-0800 (pst) 

what's being stored in mysql based on gmt.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -