javascript - Convert MYSQL time to EST -
This resulted from a mysql database
2015-01-20T23: 27: 42.000 Z How would I go about changing it to EST format? Specifically, I need to convert it to this format:
31 October 2013 12:36 AM EST So far I try to change it A UTC string like this:
var str = new date ('2015-01-20T23: 27: 42.000Z'); Str.replace ('GMT', 'EST'); Var out = new date (str); It is not doing anything and returns me the original time. help?
You want a JavaScript date object, and then a library for formatting (since it was not created ) If you do
var date = new date ('2015-01-20T23: 27: 42.000Z'); If you have a date object then, I will look for a library for formatting. A quick googling turns out which looks promising.
Comments
Post a Comment