JS implementation countdown and time object _javascript skills

Source: Internet
Author: User
Tags current time set time

The

JS implementation Countdown effect code is as follows:

<!doctype html>  

Implementation effect into the following:

Timestamp:The number of milliseconds since January 1970: Odate.gettime (); Do not ask me why it is January 1970 so far Oh! My own 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 (day);
  Odate.sethours (time, minutes, seconds, milliseconds);
  Time will be automatically carry;

Probably sorted out on these, there are a lot of inadequacies, I hope everyone to mention valuable advice! Learn from each other! Learn from each other!

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.