The solution for obtaining the current system time in JSP in the project is for reference only.
<Script language = "JavaScript">
VaR jspnowdate = new date ();
Jspnowdate. getyear (); // obtain the current year (2 digits)
Jspnowdate. getfullyear (); // obtain the complete year (4 digits, 1970-now ?)
Jspnowdate. getmonth (); // obtain the current month (0-11, 0 represents January)
Jspnowdate. getdate (); // obtain the current day (1-31)
Jspnowdate. getday (); // obtain X of the current week (0-6, 0 indicates Sunday)
Jspnowdate. gettime (); // obtain the current time (milliseconds starting from 1970.1.1)
Jspnowdate. gethours (); // obtain the current hour (0-23)
Jspnowdate. getminutes (); // obtain the current number of minutes (0-59)
Jspnowdate. getseconds (); // obtain the current number of seconds (0-59)
Jspnowdate. getmilliseconds (); // obtain the current number of milliseconds (0-999)
Jspnowdate. tolocaledatestring (); // obtain the current date
VaR jspnowtime = jspnowdate. tolocaletimestring (); // obtain the current time
Jspnowdate = jspnowdate. tolocalestring (); // obtain the date and time
// Alert (jspnowdate );
// Assign values to page elements
Document. getelementbyid ("XX"). value = jspnowdate;
</SCRIPT>