Answers for "js get the date in 15 hours"

1

get the current date time in javascript in 12 hour format

//this will give you date object remove the outer new Date to have 
//it as string
const today = new Date(new Date().toLocaleString("en-US", {
    day: '2-digit',
    month: '2-digit',
    year: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit',
    hour12: true
}));
Posted by: Guest on December-22-2020
1

javascript get 1 hour from now

Date.prototype.addHours = function(h) {
  this.setTime(this.getTime() + (h*60*60*1000));
  return this;
}
Posted by: Guest on February-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language