Display time, date, week

Source: Internet
Author: User

My friend asked a very simple question, so he was impatient to answer.

No one can tell us that we are friends.

<SCRIPT>
Document. Write ("<span id = Time> </span>") // output the container that displays the time and date.
Setinterval (function (){
With (new date)
Time. innertext = getyear () + "year" + (getmonth () + 1) + "month" + getdate () + "day week" + "five or six days on 1234 ". charat (getday () + "" + gethours () + ":" + getminutes () + ":" + getseconds ()
// Set the text in the object whose ID is time to the current date and time
}, 1000) // this segment is executed every 1000 milliseconds (that is, 1 second ).Code
</SCRIPT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.