Time and date functions allow you to customize your web pages in many different ways. Here are some of the most commonly used time and date functions:
DateValue
strResult = DateValue("September 30, 1970")
The DateValue function converts an expression into a date subtype. In this example, it returns the value "9/30/1970".
Day
strResult = Day("9/30/1970")
The Day function extracts the day value from a date expression. In this example, it returns the value "30".
Weekday
strResult = Weekday("9/30/1970")
The Weekday function extracts the day value from a date expression. In this example, it returns the value "4".
Month
strResult = Month("9/30/1970")
The Month function extracts the day value from a date expression. In this example, it returns the value "9".
Year
strResult = Year("9/30/1970")
The Year function extracts the day value from a date expression. In this example, it returns the value "1970"
Now
strResult = Now
The Now function returns the current date and time according to the current setting of the computer or server. In this example, it returns the value " 30/11/2011 07:59:42 ".
Time
strResult = Time
The Time function returns the current time according to the current settings. In this example, it returns the value " 07:59:42 ".
Hour
strResult = Hour(Now)
The Hour function returns the current time according to the current settings. In this example, it returns the value " 7 ".
Minute
strResult = Minute(Now)
The Minute function returns the current time according to the current settings. In this example, it returns the value " 59
Second
strResult = Second(Now)
The Second function returns the current time according to the current settings. In this example, it returns the value " 42 "
http://www.aspwebpro.com/aspscripts/functions/timedate.asp
No comments:
Post a Comment