ASP time functions and how to get server time

Source: Internet
Author: User

I. Common ASP Time Functions

1. now () gets the current system Date and Time. ASP output format: <% = now () %>

2. Year (now () gets the Year. ASP output format: <% = Year (now () %>

3. Month (now () obtains the current Month. ASP output format: <% = Month (now () %>

4. Get the current day by day (now (). ASP output format: <% = day (now () %>

5. hour (now () hours, ASP output format: <% = hour (now () %>

6. Minute (now () gets the number of minutes. ASP output format: <% = Minute (now () %>

7. Second (now () obtains the number of seconds. ASP output format: <% = Second (now () %>

8. Obtain the current system date by date (). ASP output format: <% = date () %>

9. time () gets the current system time. ASP output format: <% = time () %>

10. weekdayname (weekday (now) is used to obtain the current system week. ASP output format: <% = weekdayname (weekday (now) %>

II. The output result of the time function, taking "05:20:00 Friday" as an example:

1. <% = now () %> the output result is: 05:20:00
2. <% = Year (now () %> the output result is: 2013.
3. <% = Month (now () %> the output result is: 01.
4. <% = day (now () %> the output result is: 04
5. <% = hour (now () %> the output result is: 05
6. <% = Minute (now () %> the output result is: 20.
7. <% = Second (now () %> the output result is: 00
8. <% = date () %> the output result is:
9. <% = time () %> the output result is: 05: 20: 00.
10. <% = weekdayname (weekday (now) %> the output result is: Friday.

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.