JavaScript Date Methods in Geogebra

//JavaScript Date Methods [br]var d = new Date();[br]var d = new Date(2018, 11, 24, 10, 33, 30, 0);[br]var d = new Date(2018, 11, 24, 10, 33, 30);[br]var d = new Date(2018, 11, 24, 10, 33);[br]var d = new Date(2018, 11, 24, 10);[br]var d = new Date(2018, 11, 24);[br]var d = new Date(2018, 11);[br]var d = new Date(2018);[br]var d = new Date(99, 11, 24);[br]var d = new Date(9, 11, 24);[br]var d = new Date("July 11, 2020 11:13:00");[br]var d = new Date(0);[br]var d = new Date(100000000000);[br]var d = new Date(-100000000000);[br]var d = new Date(86400000);[br]////////////////////////////////////////[br]var d = new Date("2015-03-25");[br]var d = new Date("2015-03");[br]var d = new Date("2015");[br]var d = new Date("2015-03-25T12:00:00Z");[br]var d = new Date("2015-03-25T12:00:00-06:30");[br]var d = new Date("03/25/2015");[br]var d = new Date("2015-3-25");[br]var d = new Date("2015/03/25");[br]var d = new Date("25-03-2015");[br]var d = new Date("Mar 25 2015");[br]var d = new Date("25 Mar 2015");[br]var d = new Date("January 25 2015");[br]var d = new Date("Jan 25 2015");[br]var d = new Date("JANUARY, 25, 2015");[br]/////////////////////////////////////////[br]var d = new Date(Date.parse("March 21, 2012"));[br]//0-January,1-February,2-March,3-April,4-May,5-June,[br]//6-July,7-August,8-September,9-October",10-November,11-December[br]alert((d.getMonth()+1)+" "+d.getDate()+", "+d.getFullYear());[br]////////////////////////////////////////[br]//getTime[br]var d = new Date();[br]alert(d.getTime());[br]//getFullYear[br]var d = new Date();[br]alert(d.getFullYear());[br]//getMonth[br]var d = new Date();[br]alert(d.getMonth());[br]//getMonth Array[br]var d = new Date();[br]var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];[br]//0-January,1-February,2-March,3-April,4-May,5-June,[br]//6-July,7-August,8-September,9-October",10-November,11-December[br]alert(months[d.getMonth()]);[br]//getDate[br]var d = new Date();[br]alert(d.getDate());[br]//getHours[br]var d = new Date();[br]alert(d.getHours());[br]//getMinutes[br]var d = new Date();[br]alert(d.getMinutes());[br]//[br]var d = new Date();[br]alert(d.getSeconds());[br]var d = new Date();[br]alert(d.getMilliseconds());[br]var d = new Date();[br]alert(d.getDay());[br]var d = new Date();[br]var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];[br]//0-Sunday,1-Monday,2-Tuesday,3-Wednesday, [br]//4-Thursday,5-Friday,6-Saturday[br]alert(days[d.getDay()]);[br]///////////////////////////////////////////////////[br]//setFullYear[br]var d = new Date();[br]d.setFullYear(2020);[br]alert(d.getFullYear());[br]//setFullYear[br]var d = new Date();[br]d.setFullYear(2020, 11, 3);[br]alert(d.getFullYear()+","+(d.getMonth()+1)+","+d.getDay());[br]//setMonth[br]var d = new Date();[br]d.setMonth(11);[br]alert(d.getMonth());[br]//setDate[br]var d = new Date();[br]d.setDate(15);[br]alert(d.getDate());[br]//setDate[br]var d = new Date();[br]d.setDate(d.getDate() + 50);[br]alert(d.getDate());[br]//setHours[br]var d = new Date();[br]d.setHours(22);[br]alert(d.getHours());[br]//setMinutes[br]var d = new Date();[br]d.setMinutes(30);[br]alert(d.getMinutes());[br]//setSeconds[br]var d = new Date();[br]d.setSeconds(30);[br]alert(d.getSeconds());[br]//setFullYear with if-else[br]var today, someday, text;[br]today = new Date();[br]someday = new Date();[br]someday.setFullYear(2020, 03, 12);[br]if (someday > today) {[br] text = "Today is before March 12, 2020.";[br]} else {[br] text = "Today is after March 12, 2020.";[br]}[br]alert(text);[br]///////////////////////////////////////////[br]var start = [url=https://date.now/]Date.now[/url]();[br]var millis;[br]var i = 0;[br]do {[br]i = i + 1;[br]millis = [url=https://date.now/]Date.now[/url]() - start[br]} while (millis < 1000);[br]alert(i);[br]//////////////////////////////////////////[br]var start = Date.now();[br]var millis = 0;[br]var i=0;[br]while (millis < 1000) {[br]i=i+1;[br]millis =Date.now() - start[br]}[br]alert(i)

Information: JavaScript Date Methods in Geogebra