Is there any function to display date in the format mmm-dd-yyyy
in VBScript?
eg. today's date as Jan 22 2014
?
I tried using function
FormatDateTime(Now(), 2)
I got it as 16 January 2014
.
Is there any function/format to get it as Jan 16 2014
?
By using a .NET Stringbuilder - for all your formatting needs - you get the most bang for the buck:
Output:
Have a look here for background.
FormatDate
formats a date according to the format configured in the system's regional settings. If you want a custom date format using VBScript builtins, you'd do it like this:Below function will help which is returning in "dd-mmm-yyyy hh:mm:ss" format. You can customize the format according to your need.