Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Minor defense of VBScript's date handling

by dze27 (Pilgrim)
on Aug 28, 2001 at 21:19 UTC ( #108512=note: print w/ replies, xml ) Need Help??


in reply to 'use strict' is not Perl

A little offtopic, but how does VBScript mangle dates silently? I use VBScript regularly (I'm afraid perl is verboten for our production web site, I just use it for behind-the-scenes scripting) and I don't recall many surprises. The odd problem I've had has come when specifying a 6-digit date, if that's what you mean. Sometimes, depending on the locale setting on the server it may do something unanticipated to a yy-mm-dd or mm-dd-yy or dd-mm-yy date. Of course now we're in 2001 the two-digit year could be mistaken for a month or day. What I do is to always use yyyy-mm-dd format when specifying a date and let VB's internal format take care of everything. This way you don't run into any problems. Then use DateDiff, DateAdd, Year, Month, Day etc. to get all of what you need. Maybe I'm missing something, but I've found VBScript's date handling very convenient.


Comment on Minor defense of VBScript's date handling
Re: Minor defense of VBScript's date handling
by inverse (Acolyte) on Aug 28, 2001 at 21:41 UTC
    If your date format is the american style mm-dd-yy and you pass VB a string with mm > 12 it will not complain like it should. It just silently assumes you mean dd-mm-yy.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://108512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2014-12-21 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls