This is a default function within VBScript that should work in any VBScript situation.
FormatDateTime(date,format)
Date is required and has to be in a valid format but easily can accept date() or now()
Date() would only display the current date where now() would be date and time.
Format would be something like below
0 = vbGeneralDate – Default. Returns date: mm/dd/yy and time if specified: hh:mm:ss PM/AM.
1 = vbLongDate – Returns date: weekday, monthname, year
2 = vbShortDate – Returns date: mm/dd/yy
3 = vbLongTime – Returns time: hh:mm:ss PM/AM
4 = vbShortTime – Return time: hh:mm
Originally Posted on August 21, 2013
Last Updated on October 26, 2015
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.