IsTime not available in VB


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: IsTime not available in VB

  1. #1
    Join Date
    Feb 2006
    Posts
    2

    IsTime not available in VB

    IsDate determines if the date entered is a valid date, but there's not such thing for time. IsDate is available in VB but IsTime is not. why? could anyone develop this. seems so challenging though.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    IsDate works with times, too:

    Dim sTime As String
    sTime = "12:19 AM"
    Debug.Print IsDate(sTime)
    ' Prints True

    sTime = "12:62 AM"
    Debug.Print IsDate(sTime)
    ' Prints False
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Feb 2006
    Posts
    2
    thanks for the help, but my problem is determining whether the entered time in a maskedbox is a valid time or not. the syntax is this:

    If maskedbox = "__:__" Then MessageError: maskedbox.SetFocus: Exit Sub

    this only traps if there is no time entered, but if the entered time is invalid, like 03:61, it won't trap and generates an error/debug.
    Last edited by drchanix; 02-03-2006 at 10:23 PM.

Similar Threads

  1. VB as a career choice?
    By steve in forum Careers
    Replies: 8
    Last Post: 08-08-2008, 10:46 AM
  2. Told you so.... C# replacing VB
    By Bob in forum .NET
    Replies: 44
    Last Post: 06-06-2008, 05:39 AM
  3. re: moving from VB to C# -- more reasons
    By Jeff Johnson in forum .NET
    Replies: 6
    Last Post: 01-18-2007, 08:44 AM
  4. .NET vs. Enterprise Java: Who's Got Better Security?
    By Glen Kunene in forum Talk to the Editors
    Replies: 17
    Last Post: 03-23-2002, 01:43 AM
  5. VB 6 does not get error from RAISERROR in SQL stored procdure
    By Allison Boughton in forum VB Classic
    Replies: 6
    Last Post: 03-05-2001, 01:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center