Your source for ASP-related frequently asked questions and answers! : ASP FAQS : Dates and Times

Question: How can I display dates in a completely custom format (that might not be supported by FormatDateTime)?

Answer: 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!

FAQ posted by Scott Mitchell at 9/27/2000 5:10:41 PM to the Dates and Times category. This FAQ has been viewed 71,759 times.

Copyright 2021 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers