DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Time problem

  1. #1
    Join Date
    Jun 2005
    Location
    Wouldn't YOU Like to know??
    Posts
    26

    Question Time problem

    Hello!
    I'm trying to do something according to what time it is. So far, I have managed by doing this:
    Code:
    Private Sub Timer_Timer()
    Select Case Time
    Case "10:00:00 PM"
    MsgBox "It is 10 PM.", ,"The Time"
    End Select
    End Sub
    Of course, that wasn't the real code, just an idea.
    I want to do something if the current time is between two times.
    For example, a message box if it is between 10 and 10:30 PM.
    I would do this:
    Code:
    Case "10:00:00 PM" To "10:30:00 PM"
    But I can't because it is a string.
    Please help!
    (I'm doing this in VB and VB.NET, so if there is a way in NET, please post it here anyway.)
    ...I have arrived, to attempt to conquer the world with my nefarious schemes!!! You. All of you!! You shall all bow... bow, to ME!!!!

    MUWAHAHAHAHAHA!!!!!!!!!

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Code:
    If #12:30:00 AM# < Time Then
        If #1:00:00 AM# >= Time Then
            MsgBox "Current time is between 12:30 and 1:00 AM"
        End If
    End If
    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
    Jul 2005
    Posts
    8
    use
    Hour (time)
    Minute (time)
    Second (time)

    it returns numbers

Similar Threads

  1. Computers are our problem
    By Mike Mitchell in forum The Lounge
    Replies: 20
    Last Post: 02-14-2006, 08:42 AM
  2. Beta2 Southern Hemisphere Blues
    By Esmond Hart in forum .NET
    Replies: 2
    Last Post: 01-14-2002, 08:24 AM
  3. Problem with multiple users
    By drexan in forum Enterprise
    Replies: 1
    Last Post: 11-12-2001, 12:38 AM
  4. Replies: 2
    Last Post: 11-30-2000, 04:23 AM
  5. insert 20000 records time problem
    By v.des in forum Database
    Replies: 6
    Last Post: 06-06-2000, 11:21 AM

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