Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Time function

  1. #1
    Maximum Bitrate Seraph's Avatar
    Join Date
    Jun 2003
    Location
    Elmhurst, Illinois
    Posts
    672

    Time function

    My brain melted tonight.

    For the life of me, I can't figure out how to do the time function.

    I need to set the day_status to "on" or "off" depending on the time of day.
    dim day_start as string
    dim day_end as string

    day_start = "7:00 AM"
    day_end = "6:30 PM"
    If time > day_start and time < day_end
    day_status = true
    else
    day_status = false
    end if


    Something seems wrong here. What am I doing wrong?
    - Lwin M. Maung
    If it's stuck, force it. If it breaks it needed replacing anyway

  2. #2
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    It look alright, but Ill normally stick in brackets just to be sure

    If (time > day_start) and (time < day_end)

  3. #3
    Maximum Bitrate Seraph's Avatar
    Join Date
    Jun 2003
    Location
    Elmhurst, Illinois
    Posts
    672
    I got it. Brain fart tonight.

    I have to seperate it in 2

    From (morning to noon) or (noon to evening) did the trick.
    - Lwin M. Maung
    If it's stuck, force it. If it breaks it needed replacing anyway

  4. #4
    Maximum Bitrate Seraph's Avatar
    Join Date
    Jun 2003
    Location
    Elmhurst, Illinois
    Posts
    672
    If (Time > Day_Start) And (Time < "11:59 AM") Or (Time > "12:00 PM") And (Time < Day_End) Then
    Status_day = True
    Else
    Status_day = False
    End If


    This did the trick
    - Lwin M. Maung
    If it's stuck, force it. If it breaks it needed replacing anyway

  5. #5
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    The first code should be fine...it must have got cofused with the AM and PM. The 24 hours format should work

  6. #6
    Maximum Bitrate Seraph's Avatar
    Join Date
    Jun 2003
    Location
    Elmhurst, Illinois
    Posts
    672
    Why did I not think of that? 24 hour format!!!! AH!!!! I just got the mute/unmute feature.

    Thanks for the help.
    - Lwin M. Maung
    If it's stuck, force it. If it breaks it needed replacing anyway

  7. #7
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    Too much party perhaps...my brain is already aching from coding this little PIC microcontroller.

    I wish I can code big apps

  8. #8
    Maximum Bitrate carabuser's Avatar
    Join Date
    Aug 2003
    Location
    CA
    Posts
    464
    Year and a half in college

    I WISH I COULD CODE ANYTHING ! ! !
    Current Status: For Sale

    Specs
    - 1.5Ghz Toshiba Laptop (available - no screen)
    - Indash Motorized 7" VGA TS
    - DeLorme GPS (sold)
    - Power Inverter (sold)
    - Pioneer HU (sold)

  9. #9
    Variable Bitrate
    Join Date
    Dec 2003
    Location
    Michigan
    Posts
    314
    Quote Originally Posted by carabuser
    Year and a half in college

    I WISH I COULD CODE ANYTHING ! ! !
    Shouldn't have picked a managment college. they don't teach much programming there. Just kidding, couldn't resist.
    2006 Chevy Colorado: VIA M10000 EDEN, 1 GB RAM, 80 GB 2.5" Seagate HDD, USB Slim Slot DVD/RW, Holux GPS, MobileVU 10.4" LCD (touch not working yet), VOOMPC Case (blue), 70W DC-DC supply.

  10. #10
    Maximum Bitrate Seraph's Avatar
    Join Date
    Jun 2003
    Location
    Elmhurst, Illinois
    Posts
    672
    I am a network admin/database admin. I hate to code (for a living). I do code at work but nothing big. Normally scripts and such. My attention span is shorter than that of a fruit fly so I can not sit still.

    What did 5 years of college teach me? Not much at all that is useful in my day to day work. I am enjoying the interface coding though. This is kind of a break from things I do. Relaxes me.
    - Lwin M. Maung
    If it's stuck, force it. If it breaks it needed replacing anyway

Page 1 of 2 12 LastLast

Similar Threads

  1. Good time to buy carputer components?
    By Linus in forum General MP3Car Discussion
    Replies: 19
    Last Post: 11-25-2004, 08:57 PM
  2. Forum time is off by 1:00
    By frodobaggins in forum Mp3car Forum Suggestions/Comments
    Replies: 3
    Last Post: 07-31-2003, 03:30 AM
  3. Neat browser trick
    By g60 in forum Off Topic
    Replies: 6
    Last Post: 02-26-2002, 10:42 AM
  4. using both lorty's and winlcd plugins at same time
    By moahdib in forum LCD/Display
    Replies: 5
    Last Post: 08-26-2001, 01:43 PM
  5. leave LCD backlight on all the time???
    By DJ in forum General Hardware Discussion
    Replies: 5
    Last Post: 07-18-2000, 04:29 PM

Bookmarks

Posting Permissions

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