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 16/12/2018
The time now is: Time 03:11:43
The date and time is: Now 16/12/2018 03:11:43
The name of the day today is: WeekdayName(Weekday(Date)) Sunday
The abbreviated day name is: WeekdayName(Weekday(Date),True) Sun
The date is: Day(Date) 16
The name of the month is: MonthName(Month(Date)) December
The abbreviated month name is: MonthName(Month(Date),true) Dec
The month is: Month(Date) 12
The year is: Year(Date) 2018
The date 15 days ago was: DateAdd("d",-15,Date) 01/12/2018