Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old February 2nd, 2003, 05:10 PM
bella bella is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Sydney
Posts: 33 bella User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 46 sec
Reputation Power: 6
IsDate - not so obvious

I realise that the IsDate function returns true if the argument passed to it can be converted to a date....but i'm not exactly sure what formats VBScript will recognise as dates....

the examples i've seen don't cover the format i want to use, so can somebody just provide a quick answer of what IsDate will return if i pass it a date in the format: 24/Jan/1984, that is, dd/mmm/yyyy....hopefully it will return true

Reply With Quote
  #2  
Old February 3rd, 2003, 11:15 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Well, first I would say try it and see.
Here is more info on the function:
http://msdn.microsoft.com/library/d...vsfctisdate.asp

Reply With Quote
  #3  
Old February 27th, 2003, 03:12 PM
ngibsonau ngibsonau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 138 ngibsonau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Be aware that the windows locale will affect dates, currency etc.

In particular dates dd/mm/yyyy and mm/dd/yyyy are ambiguous for small values of dd and mm for a lot of windows date functions.

If you have a locale which takes dd/mm/yyyy but put an invalid month value in and have a day that will be a valid month, the values will be magically switched.
eg. 10/20/2003 will be converted into 20th October 2003 which under the dd/mm/yyyy will actually be 20/10/2003.

So the try it and see method may get a bit confusing.
__________________
--

ngibsonau

Reply With Quote
  #4  
Old March 1st, 2003, 09:39 PM
customfittech customfittech is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: St. Louis, MO USA
Posts: 43 customfittech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
you could always detect your 80% locales and provide a parse function depending on the locale, assuring that the date is properly formatted before entering your code.

But from personal experience, I have found that usually problems like these are best kept out of back end code, and solved by very very rigid user input code and clear instructions. If this is NOT a user interface input method for your date value, then I would analyze your data and rule out certain "out there" circumstances, and only code for the crazy stuff when and if it occurs. This may sound lazy, but as I am paid hourly as a freelance consultant, I just inform the client of my decision and they are usually thankful to save the money up front.
__________________
- Chris of Custom Fit Technology
http://www.customfittech.com

Access to MySQL Conversion Tool,
Visual XSLT Conversion Tool

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > IsDate - not so obvious


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway