JS implementation countdown and Time object

Source: Internet
Author: User

JS implementation of the countdown effect code is as follows:

 1 <!doctype html> 2 

Implementation results in the following:

Timestamp: The number of milliseconds since January 1970 to date: Odate.gettime (); Don't ask me why it is January 1970 so far Oh! Baidu!
Time object:
   Get Time:
var odate = new Date ();
Oyear = Odate.getfullyear ();
OMon = Odate.getmonth ();
Oday = Odate.getdate ();
Ohou = Odate.gethours ();
Omin = Odate.getminutes ();
OSec = Odate.getseconds ();
Oweek = Odate.getday ();

Set Time:
Odate.setfullyear (year, month, day);
Odate.setmonth (month);
Odate.setdate (Sun);
Odate.sethours (hours, minutes, seconds, milliseconds);
Time is automatically rounded up;

Probably finishing on these, there are a lot of deficiencies, I hope you have more valuable advice! Learn from each other! Learn from each other! ~ ~  ^_^

JS implementation countdown and Time object

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.