ASP TUTORIAL - TIME & DATE
The time and date are two of the many built-in functions of ASP. Built-in functions associated with, or can be use with, time and date are:
- now - display current time & date information, e.g. 5/14/02 10:10:15AM.
- hour - use hour(now) to get a number from 0 to 23.
- minute - use minute(now) to get a number from 0 to 59.
- second - use second(now) to get a number from 0 to 59.
- day - use day(now) to get a number from 1 to 31.
- year - use day(now) to get a 4 digit year, e.g. 2002. You can change this to show only the last two digits.
- month - use month(now) to get a number from 1 to 12.
- monthname - use monthname(month(now)) to get the name of the month.
- weekday - use weekday(now) to get a number from 1 to 7 where 1 is Sunday and 7 is Saturday.
- weekdayname - use weekdayname(weekday(now)) to get the name of the day.
All of these can be shown on the web page by using the equal sign (=) before the function name. For example,
Click Here To See Examples.
The equal sign (=) tells the server to display the function or variable.