Domanda

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!

È stato utile?

Soluzione

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);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top