Skip to content

Commit

Permalink
24h timestamp.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse-Hufstetler committed Sep 13, 2023
1 parent 3b7f670 commit cbbf764
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions timestamp.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
var year = now.getFullYear();
var month = zeroPad(now.getMonth() + 1, 2);
var day = zeroPad(now.getDate(), 2);
var amPm = now.getHours() >= 12 ? `PM` : `AM`;
var h12 = zeroPad((now.getHours() + 11) % 12 + 1, 2);
var h = zeroPad(now.getHours(), 2);
var mins = zeroPad(now.getMinutes(), 2);
var secs = zeroPad(now.getSeconds(), 2);
document.getElementById('stamps').innerText = `
${now}
${year}_${month}_${day}_${amPm}_${h12}_${mins}_${secs}
${year}_${month}_${day}__${h}_${mins}_${secs}
`;
</script>
</body>
Expand Down

0 comments on commit cbbf764

Please sign in to comment.