Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Digital clock of js

Shulou Source: shulou.com Published: 2022-06-03 03:20:43 11月17日 Update

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.

Tags: Month character string number clock position poly finger year year month day document date time label title source code type Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL Microsoft OPPO Reno Shulou Tech Info