Skip to content

Instantly share code, notes, and snippets.

function timestamp() {
const currentDate = new Date();
const day = currentDate.getDate();
const month = currentDate.getMonth() + 1;
const year = currentDate.getFullYear();
const hours = currentDate.getHours();
const minutes = currentDate.getMinutes();
const seconds = currentDate.getSeconds();
let ms = currentDate.getMilliseconds();
if (ms < 10) {