Truncate Time To Second - Node.js Date

Node.js examples for Date:Second

Description

Truncate Time To Second

Demo Code


function truncateTimeToSecond(date_obj) {
  return new Date(Math.floor(date_obj.valueOf() / 1000) * 1000)
}

Related Tutorials