Results 1 to 2 of 2

Thread: IsDate Function

  1. #1

    Thread Starter
    Hyperactive Member gravyboy's Avatar
    Join Date
    Jan 2000
    Location
    Where I was before . . . if you don't know then you're new!
    Posts
    334

    IsDate Function

    Aaaggghhh IsDate("0.00") = True!!!! Pain in the arse . . . .

    VB Code:
    1. If IsDate (strItem) Then
    2.     strItem = Format$(strItem, "dd-mmm-yyyy")
    3. End If

    if strItem is a numeric string ie "0.00", "1.5" etc. then this returns a true. I assume that this is because it's interpreting it as the number of days since 31-dec-1899.

    Pain in the arse, what use is a validation function that only fails non-numeric characters?

    Rant over . . . .
    Matt G
    VS6 Ent SP5 @ Work
    VS6 Ent SP5 & VB.Net @ Home
    [email protected]



  2. #2
    Hyperactive Member Foxer's Avatar
    Join Date
    Oct 2001
    Location
    Australia
    Posts
    278

    Same Here

    My problem is similiar :-

    IsDate("31 06 02") returns true (too many days in month).

    The problem is that VB adopts the 31 as the year and converts string to 02 06 1931.

    I'm investigating the
    Day()
    Month()
    Year()

    functions. If there is a public function published somewhere I've yet to find it.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width