In a previous FAQ, we looked at how to use the VBScript function FormatDateTime to nicely format a date variable. Unfortunately, the FormatDateTime function only allows for five different formats. To have complete control over the look and feel of how your date variables are displayed, you will need to create a custom date formatting function.
Fortunately, such a function has already been created (and is on 4Guys!). This function is provided and explained in this article. Be sure to try out the live demo as well!
With the code presented in the article above, you will be on your way to having complete control over the format of your date variables! Happy Programming!
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.