IRL Time and Date Detector?

Is there any way I can make events detect what time and date it is in real life and have switches activate at a certain time/date?
Yup, just create a Date object.

Code:
const date = new Date();
date.toDateString();
date.toLocaleTimeString();
date.toISOString();
date.toGMTString();
// etc. etc.
// All possible types are listed at the link above
There are a ton of different possible formats, all of which are documented in the link above.
Yup, just create a Date object.

Code:
const date = new Date();
date.toDateString();
date.toLocaleTimeString();
date.toISOString();
date.toGMTString();
// etc. etc.
// All possible types are listed at the link above
There are a ton of different possible formats, all of which are documented in the link above.

Hey, sorry to bother you but I'm a noob at Javascript, so is there any way I can make it only detect the month, date, and time?
Of course! Here are the relevant functions with links to their documentation.

Month:
date.getMonth()

Date:
date.getDate()

Time:
Like I said above, there are a ton of possible formats, so it's better for you to look through the options and decide what you want. Here's one option:
date.toLocaleTimeString()

Original thread: https://forums.rpgmakerweb.com/threads/irl-time-and-date-detector.104428/