Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isItTenAM() {
- const now = new Date();
- const hours = now.getHours();
- const minutes = now.getMinutes();
- // Check if the current time is exactly 10:00 AM
- return hours === 10 && minutes === 0;
- }
- if (isItTenAM()) {
- console.log("It's 10:00 AM!");
- } else {
- console.log("It's not 10:00 AM yet.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement