140926 ● Date and Time operations, mathematical function operations, Form Verification

Source: Internet
Author: User

Date and Time operations:
VaR d = new date ();
VaR d = new date (, 5); // The time is

D. getfullyear (); year
D. getmonth (); month (normal-1)
D. getdate (); Day
D. getday (); day of the week
D. gethours ();
D. getminutes ();
D. getseconds ();

 

Mathematical function operations:
Math. Ceil ();
Math. Floor ();
Math. Round ();
Math. Random ();
Math. SQRT ();

 

Form Verification:
1. Non-empty verification (remove space)
2. Comparison and verification: Compare with a value
3. Range verification: Based on the range
4. fixed format verification: such as phone number, ID card number ......
Regular Expression

5. Other Verification

 

Regular Expression

Syntax form var A =/regular expression content /;

^ -- Match the beginning
$ -- Matching end
\ D -- any number
\ W -- a person's number or letter
{N} -- repeat the expression on the left n times
{M, n} -- repeat the expression on the left M ~ N times
{M ,}-- repeat the expression on the left at least m times, not limited
+ -- The expression on the left appears at least once, but not limited to {1 ,}
* -- The expression on the left must appear at least 0 times, but not limited to {0 ,}
? -- The expression on the left appears at least 0 times, at most 1 time, equivalent to {0, 1}
[A, B, c] -- only one of the brackets can be taken.
[A-Z] or [0-9] -- Take 1 in the range
| -- Or
() -- Priority
\ -- Escape

 

140926 ● Date and Time operations, mathematical function operations, Form Verification

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.