473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

IsDate problem

Why does

IsDate("01:01:0_")

return true??

Thanks

Jack Russell
Nov 21 '05 #1
5 2386
Jack Russell,

IsDate is a visual basic function (6), try to use something like
Date.Parse(01:01:0_") or Date.ParseExact(01:01:0_") and see if you
still get the same error.

Rykie

Nov 21 '05 #2
Fair enough but if vb.net supports it shouldn't it work?
Rykie wrote:
Jack Russell,

IsDate is a visual basic function (6), try to use something like
Date.Parse(01:01:0_") or Date.ParseExact(01:01:0_") and see if you
still get the same error.

Rykie

Nov 21 '05 #3
Jack Russell wrote:
Why does

IsDate("01:01:0_")

return true??


Because it can be parsed to #1:01:00 AM# (and it seems to think the date in
the sense you intend is 01/01/0001).

I suppose you could parse it with MyDate=CDate("01:01:0_") and if
MyDate.Year=1 then it was only a time without a date. Unless 1 is a valid
year in your application.

Andrew
Nov 21 '05 #4
"Rykie" <ry**********@gmail.com> schrieb:
IsDate is a visual basic function (6), try to use something like
Date.Parse(01:01:0_") or Date.ParseExact(01:01:0_") and see if you
still get the same error.


'IsDate' doesn't have a bug. 'CDate' is able to interpret the string
"01:01:0_" as a valid time string.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
"Jack Russell" <ja***@norubbish.tpg.com.au> schrieb:
Fair enough but if vb.net supports it shouldn't it work?


It actually works. However, 'IsDate'/'CDate' of VB.NET are not compatible
to VB6's 'IsDate'/'CDate' functions/commands:

\\\
MsgBox(IsDate("11a")) ' 'True' in VB6, 'False' in VB.NET...
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Vladislav | last post by:
Could somebody comment the folowing log from immediate panel: ? isdate("0A0-0002") True ? cdate("0A0-0002") 01/02/2000 I would expect the value "0A0-0002" as not date
0
by: vonclausowitz | last post by:
Hi All, I use IsDate() to check a field in Outlook tasks to see if it contains a real date. If IsDate(Task.role) then ... else ... endif
2
by: EP | last post by:
I just upgraded a V 6.0 app. to .Net. I keep getting an error from a simple IsDate statement. Basically checking to see if the value of a variable(vValue = "A2957") is a date example - If...
4
by: John A Grandy | last post by:
IsNumeric() and IsDate() are "leftovers" from the VB6 days ... looking forward, perhaps it would be better not to use them .... does anyone have suggestions on replacements ?
1
by: Sebastian Santacroce | last post by:
Hi, I am trying to use IsDate where the application will use a format of Month/day/year however on a system that uses day/month/year then IsDate uses that system format setting when evaluating if...
2
by: Oenone | last post by:
I'm having a couple of problems with the IsDate function in VB.net (.net framework v1.1). Having searched the web and usenet for others having the same problem, I've seen several posts from people...
2
by: z. f. | last post by:
Hi, i see in reflector in inner implementation of the Microsoft.VisualBasic.Information.IsDate function that looks like that: public static bool IsDate(object Expression) { if (Expression !=...
19
by: MDC | last post by:
Why does this return true: IsDate("ISometimesHateProgrammingMarch2005") Is there another way to verify that this is not a date?? Thanks in advance! MDC
1
by: nlulla | last post by:
Hi I am trying to get all rows from a datatable where the first column F1 is a date, as this datatable is created of excel, i only want to deal with rows where the first column is having a date in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.