JS method for obtaining year, month, day, hour, minute, and second

Source: Internet
Author: User
JS method of obtaining year, month, day, hour, minute, and second. This article analyzes how JS method of obtaining year, month, day, hour, minute, and second. We will share this with you for your reference. The details are as follows:

Var d = new Date (); var time = d. getFullYear () + "-" + (d. getMonth () + 1) + "-" + d. getDate () + "" + d. getHours () + ":" + d. getMinutes () + ":" + d. getSeconds ();

It must be so complicated that there is no way.

I thought jQuery would be able to streamline its functions, but I didn't find it.

You can only use this original method to obtain the information of year, month, day, hour, minute, and second.

Tips:

Javascript cannot contain spaces when passing parameters. Otherwise, no data can be obtained.

Url = "send. php? Action = record_info & order_id = "+ $ (" # order_id "). val () +" & remark = "+ $ ('# remark'). val ();

There are spaces before and after the equal sign after the preceding remark parameter, resulting in no data being obtained.

Correct syntax:

Url = "send. php? Action = record_info & order_id = "+ $ (" # order_id "). val () +" & remark = "+ $ ('# remark'). val ();
Related Article

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.