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' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -