Last active
May 30, 2023 12:51
-
-
Save boyum/6d841090e885b88be2a2903b9eed7a3d to your computer and use it in GitHub Desktop.
Example JS file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
const formatNumber = num => num.toString().padStart(2, '0'); | |
const now = new Date(); | |
const hours = formatNumber(now.getHours()); | |
const minutes = formatNumber(now.getMinutes()); | |
const seconds = formatNumber(now.getSeconds()); | |
const time = `${hours}:${minutes}:${seconds}`; | |
console.log(`Hi! ✨ The time is ${time}`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment