Example of common methods for Date objects in JavaScript: javascriptdate
GetFullYear ()
Use getFullYear () to obtain the year.
Source code:
</script><!DOCTYPE html>
Test results:
2015
GetTime ()
GetTime () returns the number of milliseconds since January 1, January 1, 1970.
Source code:
<!DOCTYPE html>
Test results:
1445669203860
SetFullYear ()
How to Use setFullYear () to set a specific date.
Source code:
<!DOCTYPE html>
Test results:
Tue Nov 03 2020 14:47:46 GMT + 0800 (Chinese Standard Time)
ToUTCString ()
How to Use toUTCString () to convert the date of the current day (based on UTC) to a string.
Source code:
<!DOCTYPE html>
Test results:
Sat, 24 Oct 2015 06:49:05 GMT
GetDay ()
How to Use getDay () and array to display the week, not just a number.
Source code:
<!DOCTYPE html>
Test results:
Saturday
Display a clock
How to display a clock on a webpage.
Source code:
<!DOCTYPE html>