Answers for "convert dd/mm/yyyy to unix timestamp javascript"

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
0

convert date to unix timestamp javascript

new Date('2012.08.10').getTime() / 1000 //secs
new Date('2012.08.10').getTime() //milliseconds
Posted by: Guest on December-24-2020

Code answers related to "convert dd/mm/yyyy to unix timestamp javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language