unix time to date javascript
const unixTime = 1210981217;
const date = new Date(unixTime*1000);
console.log(date.toLocaleDateString("en-US"));
//expected: "5/16/2008"
unix time to date javascript
const unixTime = 1210981217;
const date = new Date(unixTime*1000);
console.log(date.toLocaleDateString("en-US"));
//expected: "5/16/2008"
convert timestamp to utc javascript
function utcformat(d){
d= new Date(d);
var tail= 'GMT', D= [d.getUTCFullYear(), d.getUTCMonth()+1, d.getUTCDate()],
T= [d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds()];
if(+T[0]> 12){
T[0]-= 12;
tail= ' pm '+tail;
}
else tail= ' am '+tail;
var i= 3;
while(i){
--i;
if(D[i]<10) D[i]= '0'+D[i];
if(T[i]<10) T[i]= '0'+T[i];
}
return D.join('/')+' '+T.join(':')+ tail;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us