jquery - Javascript how to convert epoch into local date -


i'm converting epoch date local date:

$("time").each(function() {     var date = $(this).text(); // gives me "1325419200000"     newdate = new date(date); // gives me invalid date }); 

html:

<td class="date">     <time datetime="{{date}}">{{date}}</time> </td> 

how can convert epoch date local date in format: 'mmm dd, yyyy h:mm:ss a'. how can achieve this?

dateobject won't accept string epoch. need convert integer.

check out

var epoch = "1325419200000" var date = new date(epoch); // return invalid date  date = new date(parseint(epoch)); //return sun jan 01 2012 21:00:00 gmt+0900 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -