Use the FormatDateTime function. FormatDateTime takes two input paraemeters, a required date variable and an optional date format. There are five different date formats available:
vbGeneralDate - displays a date as a short date and a time as a long time. vbLongDate - displays a date in the long format vbShortDate - displays a date in the short format vbLongTime - displays a time using the long format vbShortTime - displays a time using the 24-hour format
The long and short formats are specified by the regional settings on the Web server. An example of using the FormatDateTime function can be seen below:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.