Answers for "new date javascript get time"

0

Get data and time in javascript

var date_time = new Date().toLocaleString();
console.log(date_time);
Posted by: Guest on April-20-2021
8

javascript current date time

var today = new Date().toLocaleDateString(undefined, {
    day: '2-digit',
    month: '2-digit',
    year: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
    second: '2-digit'
})
Posted by: Guest on April-07-2020
3

get time from date javascript

const handleTime = (dataD) => {
    let data= new Date(dataD)
    let hrs = data.getHours()
    let mins = data.getMinutes()
    if(hrs<=9)
       hrs = '0' + hrs
    if(mins<10)
      mins = '0' + mins
    const postTime= hrs + ':' + mins
    return postTime
  }
Posted by: Guest on August-08-2020
4

javascript get Time

var d=new Date();
d.getTime();//I'm in milliseconds, divide by 1000 for seconds
Posted by: Guest on June-28-2019

Code answers related to "new date javascript get time"

Code answers related to "Javascript"

Browse Popular Code Answers by Language