|
-
Feb 14th, 2000, 07:21 AM
#1
Thread Starter
Junior Member
I have a VB6 application that manages dates in many ways and one of my customers likes to use a period (".") as date separator in its regional settings. The glitch is that it does not seem to be supported by VB since when I use a period as date separator and I call...
IsDate(Format(Now))
- or -
IsDate("01.01.2000")
...it always return False. And when I call...
CDate(Format(Now))
- or -
CDate("01.01.2000")
...it gives me a run-time 13 (Type Mismatch).
Even if I use other separators for decimal and thousand, it keeps failing.
Anybody has ever heard of this? If so, does somebody have a solution?
My application is quite big and I am affraid workarounds would not solve my problem.
Thanks in advance,
Tipi
-
Feb 14th, 2000, 05:40 PM
#2
-
Feb 14th, 2000, 06:23 PM
#3
Hyperactive Member
One thing you can do is use the VB6 Replace function to replace the . with - ....
eg.
Dim sTemp As String
sTemp = Replace(txtDate.Text, ".", "-")
And then use sTemp to check if entered date is valid.
-
Feb 14th, 2000, 10:44 PM
#4
Thread Starter
Junior Member
I guess I was not clear enough. I already use a period in my regional settings. The problem is that:
IsDate("01.JAN.2000")
- and -
IsDate(Format(Now))
return False. The second example will work if you use a MM month format. It will fail with a MMM month format. I have made a mistake in my first message when I mentionned that "01.01.2000" would return False.
Thanks,
Tipi
[This message has been edited by Tipi (edited 02-15-2000).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|