Time and Date Functions ASP Script - ASP Web Pro
  Active Server Pages Programming by ASP Web Pro

ASP Scripts

TIME AND DATE FUNCTIONS

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 " 10/05/2008 00:50:22 ".

Time

strResult = Time

The Time function returns the current time according to the current settings. In this example, it returns the value " 00:50:22 ".

Hour

strResult = Hour(Now)

The Hour function returns the current time according to the current settings. In this example, it returns the value " 0 ".

Minute

strResult = Minute(Now)

The Minute function returns the current time according to the current settings. In this example, it returns the value " 50

Second

strResult = Second(Now)

The Second function returns the current time according to the current settings. In this example, it returns the value " 22 "

< Back to ASP Scripts


 

 

Main Menu
Home
ASP Scripts
ASP Tutorials
JavaScripts
Awards
Contact Us

Email This Page

Other Resources
ASP Web Hosting
Search Engine Submission
Programming Help

 

 

 

Other ASP Web Sites

Site Map

 

Last Updated:
10 May 2008