VBScript date & time functions for ASP pages

Set the Locale for the UK on the page using: SetLocale(2057)

Copy and paste any of the following functions into your ASP pages.

  Function Output
The date today is: Date 06/10/2008
The time now is: Time 23:29:11
The date and time is: Now 06/10/2008 23:29:11
The name of the day today is: WeekdayName(Weekday(Date)) Monday
The abbreviated day name is: WeekdayName(Weekday(Date),True) Mon
The date is: Day(Date) 6
The name of the month is: MonthName(Month(Date)) October
The abbreviated month name is: MonthName(Month(Date),true) Oct
The month is: Month(Date) 10
The year is: Year(Date) 2008
The date 7 days ago was: DateAdd("d",-7,Date) 29/09/2008