controlling time

December 18, 2002 under Computers, Programming

Did you know that formatting dates in Visual Basic cannot be accomplished the same way in Visual Basic Script? It’s true. This Visual Basic snippet:

Dim strCurrDate As String
 
   strCurrDate = Format(Now(), "Short Date")

will not work with Visual Basic Script. The Format() function isn’t available to Visual Basic Script, but there is a FormatDateTime() function that appears to be identical. Instead, the VBS equivalent would be something like this:

Dim strCurrDate
 
   strCurrDate = FormatDateTime(Date, 2)

Why the need for a similar function but with a different name? I don’t know, but I guess you learn something new everyday. I learned this while working on a server-side script for our Microsoft Exchange Server at work.

Apparently, the funeral for Father Les _was_ a big event. Some pics of it can be found here.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>