سؤال

is there a way to convert a complex time stamp to a simple one using javascript? i'd like to go from:

06-Feb-14 3:15 AM EST

to just:

3:16 AM

thanks!

هل كانت مفيدة؟

المحلول

I would recommend datejs . You'll have good functionality to do what you need.

One example.

var mydate = Date.parse('2012-02-18 14:28:32');
var result = mydate.toString('dddd MMM yyyy h:mm:ss');
console.log(result);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top