Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Pseudo
Wanderer


Joined: 25 Oct 2005
Posts: 99

PostPosted: Fri Oct 28, 2005 10:18 pm   

Date Formatting
 
I am having trouble with the following:
#mss {mydate=Format(DateAdd(~"m~", -1, Date),~"Long Date~")}
It gives a Type mismatch: 'Format' (error 13) on line 1, column 1

while
#mss {mydate=DateAdd(~"m~", -1, Date)}
displays properly.

Using
#show %mss(%eval(mydate))
to evaluate the expression.

Any advice would be appreciated.
Thanks!
Reply with quote
Pseudo
Wanderer


Joined: 25 Oct 2005
Posts: 99

PostPosted: Sat Oct 29, 2005 12:41 am   
 
Seems I get to answer my own question.
Format() is a VBA function.
FormatDateTime is a VBScript function.
The correct function is FormatDateTime()
Here is an example:

#SHOW %eval(%mss(FormatDateTime(Now(), vbLongDate)))

Constant Code Result Example
0 FormatDateTime(Now(), vbGeneralDate) 11/15/2010 2:23:43 PM
1 FormatDateTime(Now(), vbLongDate) Saturday, January 14, 2904
2 FormatDateTime(Now(), vbShortDate) 11/15/2010
3 FormatDateTime(Now(), vbLongTime) 4:24:21 AM
4 FormatDateTime(Now(), vbShortTime) 04:24

Simply replace vbLongDate with the desired Code Result.

Cheers!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net