Answers for "unix timestamp to date javascript yyyy-mm-dd"

0

unix timestamp to date javascript yyyy-mm-dd

function timeConverter(UNIX_timestamp){
  var a = new Date(UNIX_timestamp * 1000);
  var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
  var year = a.getFullYear();
  var month = months[a.getMonth()];
  var date = a.getDate();
  var hour = a.getHours();
  var min = a.getMinutes();
  var sec = a.getSeconds();
  var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;
  return time;
}
Posted by: Guest on September-26-2020

Code answers related to "unix timestamp to date javascript yyyy-mm-dd"

Code answers related to "Javascript"

Browse Popular Code Answers by Language