I have a long numbber in array in javascript. It was taken from getTime(), but now its not an Date object.
tab[0][1]=1373139837555;// not date object - just int
And now I want to print it like this
Hour:Minute:Seconds | Day/Month/Year
Is there any function to print date? I know the functions getHours(), getMinutes(), getTime(), but they only work for Date objects. Can I turn this long number to date? How can I print the date otherwise?
EDIT
This is my code with javascript and JQ
$.date = function (dateObject) {
var d = new Date(dateObject);
var hour = d.getHours();
var minutes = d.getMinutes();
var seconds = d.getSeconds();
var day = d.getDate();
var month = d.getMonth();
var year = d.getFullYear();
var date = hour+":"+minutes+":"+seconds+"||"+day+"/"+month+"/"+year;
return date;
};
tab[0][1]=1373139837555;
console.log('Number '+$.date(tab[0][1]));
And it returns Number NaN:NaN:NaN || NaN/NaN/NaN :( When I chech the tab[0][1] with is NaN it returns false - so it is a number