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/09/2010
The time now is: Time 16:23:36
The date and time is: Now 06/09/2010 16:23:36
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)) September
The abbreviated month name is: MonthName(Month(Date),true) Sep
The month is: Month(Date) 9
The year is: Year(Date) 2010
The date 15 days ago was: DateAdd("d",-15,Date) 22/08/2010