Torgeir
Mon Nov 29 09:02:39 CST 2004
John Coltrane wrote:
> how can I get a date in the following format
>
> dd-mmm-yyyy
>
> ie 01-APR-1999
>
> in visual basic I can use the formatdate function and the formatting
> is flexible enough to create this string. In vbscript the
> functionality seems more limited. Is there a simple way to do this?
Hi
'--------------------8<----------------------
sNow = Now
sMyDate = Right(100 + Day(sNow), 2) & "-" _
& MonthName(Month(sNow), True) & "-" & Year(sNow)
WScript.Echo sMyDate
'--------------------8<----------------------
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx