Shop OBEX P1 Docs P2 Docs Learn Events
time extraction — Parallax Forums

time extraction

ArchiverArchiver Posts: 46,084
edited 2000-11-03 20:33 in General Discussion
I need to extract the seconds value from the TIME$ function using
Quick Basic. I have been able to get the hours and minutes values
by using the val(left $)and val(mid) functions but the val(right$)
always returns a "0". Can someone shed some light on this or is
a quirk of QB or the function itself?
I am using a Stamp2 in this project but the time keeping and logging
is being handle on a PC.
TIA, Frank
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk! For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-11-02 12:45
    If you just want the string of the seconds use

    somestring = mid$(time$,7,2)

    or the numeric 'value'

    someval = val(mid$(time$,7,2))

    Hope this helps
    Bob


    At 07:31 AM 11/2/00 -0500, you wrote:
    >I need to extract the seconds value from the TIME$ function using
    >Quick Basic. I have been able to get the hours and minutes values
    >by using the val(left $)and val(mid) functions but the val(right$)
    >always returns a "0". Can someone shed some light on this or is
    >a quirk of QB or the function itself?
    > I am using a Stamp2 in this project but the time keeping and logging
    >is being handle on a PC.
    >TIA, Frank
    >________________________________________________________________
    >YOU'RE PAYING TOO MUCH FOR THE INTERNET!
    >Juno now offers FREE Internet Access!
    >Try it today - there's no risk! For your FREE software, visit:
    >http://dl.www.juno.com/get/tagj.
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-03 20:33
    Thank you! The valMid$(time$,7,2)... did the trick.

    Frank

    On Thu, 02 Nov 2000 07:45:24 -0500 Sample Bandit <tesla@i...> writes:
    >
    >If you just want the string of the seconds use
    >
    >somestring = mid$(time$,7,2)
    >
    >or the numeric 'value'
    >
    >someval = val(mid$(time$,7,2))
    >
    >Hope this helps
    >Bob
    >
    >
    >At 07:31 AM 11/2/00 -0500, you wrote:
    >>I need to extract the seconds value from the TIME$ function using
    >>Quick Basic. I have been able to get the hours and minutes values
    >>by using the val(left $)and val(mid) functions but the val(right$)
    >>always returns a "0". Can someone shed some light on this or is
    >>a quirk of QB or the function itself?
    >> I am using a Stamp2 in this project but the time keeping and
    >logging
    >>is being handle on a PC.
    >>TIA, Frank
    >>________________________________________________________________
    >>YOU'RE PAYING TOO MUCH FOR THE INTERNET!
    >>Juno now offers FREE Internet Access!
    >>Try it today - there's no risk! For your FREE software, visit:
    >>http://dl.www.juno.com/get/tagj.
    >>
    >>
    >>
    >>
    >>
    >
    >
    >
    >

    ________________________________________________________________
    YOU'RE PAYING TOO MUCH FOR THE INTERNET!
    Juno now offers FREE Internet Access!
    Try it today - there's no risk! For your FREE software, visit:
    http://dl.www.juno.com/get/tagj.
Sign In or Register to comment.