Digital clock of js
The following is the digital clock I wrote with js, the source code of the year, month, day, date and time, please give me more advice:
Untitled document
P {font-size:36px;}
Window. ()
{
Var oP=document.getElementById ('p1'); / / get the location of the p tag
Function colock ()
{
Var oData= new Date ()
Var oT1=oData.getFullYear (); / / get the year
Var oT2= (oData.getMonth () + 1) .toString (); / / gets the month and converts it to a string type. Month gets the month from 0 to 11, so it needs + 1. It is convenient to convert to a string.