In JavaScript, we can create a new date using:
var date1 = new Date("2018-01-01");
If we print this in the console, we actually get a different date:
This is because we are omitting the time, so UTC time is assumed. To display the “correct” date, add the time:
var date1 = new Date("2018-01-01 00:00");
This produces:
THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.
IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.
THANK YOU, AND LET'S KEEP LEARNING TOGETHER.
CARL