Get the time context. timestamp on the server

Source: Internet
Author: User

Get the time on the server: context. Timestamp
------------------------------
Specific time:
Context. timestamp. timeofday. tostring ()
Year, month, and day:
Context. Timestamp
Year:
Context. timestamp. Year
Month:
Context. timestamp. Month
Date:
Context. timestamp. Date
Date:
Context. timestamp. Day
Week:
Context. timestamp. dayofweek
The day of the year:
Context. timestamp. dayofyear
Hours:
Context. timestamp. Hour
Millisecond:
Context. timestamp. millisecond
Classification:
Context. timestamp. Minute
Seconds:
Context. timestamp. Second
-------------------------------------
Obtain the server system name:
Context. server. machinename
Obtain the server IIS running timeout in milliseconds:
Context. server. scripttimeout
Get the handler of the page:
Context. Handler
-------------------------------------
Compare these two sentences:
Context. server. Transfer ("test. aspx ");
Response. Redirect ("test. aspx ");
When the statement is executed, view the changes in the browser address bar.
Response. Redirect is address conversion. Context. server. Transfer is called within the page.
Use context. server. Transfer and context. rewritepath in combination:
Context. rewritepath ("text. aspx? A = 100 ");
Context. server. Transfer ("test. aspx ");
Equivalent to response. Redirect ("test. aspx? A = 100 ");
However, the difference is that context. server. Transfer is called within the page.
Of course, the above two sentences are also written into one sentence:
Context. server. Transfer ("test. aspx? A = 199 ");
The results are the same.

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.