A Better Moustrap: FmtDate to replace FormatDateTime
Have you ever been frustrated with the lack of options with visual basic script's built in function FormatDateTime? If so, then this function is for you- and it demonstrates how simple it is to build very complex search-and-relace functions.
Once you've added the two functions below to your ASP or VBS file, you can call the function just like any other function. Two parameters are required, the first is the date/time value you want to re-format, and the second parameter is the format you want. For all the different options you can use in the format, check out the comments at the top of FmtDate.
I'm not the original author of this function, but I've added and changed a lot of it to make it more useful. I've used it and modified so much for so many years, I don't even know where the original version came from.
Here it is, have fun!
example:
returns
Here's the function(s). You need both for it to work properly! FmtDate calls
Select All Code
|
|
|
|