![]() |
|
|
Date and Time Greetings using VBScript functionsBelow is some sample code that will greet your visitors based on the hour of the day and the day of the week. Hour of the day greeting <% If h<12 then Below is our code in action: Good afternoon! Day of the week greetingThe function WeekDay accepts a date as an argument. It returns a number between 1 and 7. Sunday is number 1, being the first day of the week. <% Below is our code in action: Hello, it's work time! For our code above we could also have used the WeekdayName function that will accept a number between 1 and 7 and return the corresponding day. <% Below is our code in action: Hello, it's work time! Other date and time related tutorials: Read more on the Date, Time and Now VBScript functionsHere's a code snippet to display the day and date (eg. Mon 25 December). Here's a code snippet to display the day and date with the ordinal suffix (eg. Mon 25th December). How to get the current month name Display the dates and times IsDate Function The DateDiff DateAdd and DatePart Functions
Site developed by Michael Wall - Web Design Belfast N.Ireland. |
|