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 18/02/2019
The time now is: Time 01:45:43
The date and time is: Now 18/02/2019 01:45:43
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) 18
The name of the month is: MonthName(Month(Date)) February
The abbreviated month name is: MonthName(Month(Date),true) Feb
The month is: Month(Date) 2
The year is: Year(Date) 2019
The date 15 days ago was: DateAdd("d",-15,Date) 03/02/2019