by Robert Partel (no login)


OPEN "boot.txt" FOR INPUT AS #1 ' text document created on boot
LINE INPUT #1, bootdate$ ' that saves the date
LINE INPUT #1, boottime$ ' and time of the boot
CLOSE #1 ' close file

bootmonth = VAL(LEFT$(bootdate$, 2)) 'the bootmonth isolated from bootdate$
bootday = VAL(MID$(bootdate$, 4, 2)) 'the bootday isolated from bootdate$
bootyear = VAL(RIGHT$(bootdate$, 4)) 'the bootyear isolated from bootdate$
boothour = VAL(LEFT$(boottime$, 2)) 'the boothour isolated from boottime$
bootminute = VAL(MID$(boottime$, 4, 2)) 'the bootminute isolated from boottime$
bootsecond = VAL(RIGHT$(boottime$, 2)) 'the bootsecond isolated from boottime$

nowmonth = VAL(LEFT$(DATE$, 2))) 'the month isolated from DATE$
nowday = VAL(MID$(DATE$, 4, 2))) 'the day isolated from DATE$
nowyear = VAL(RIGHT$(DATE$, 4))) 'the year isolated from DATE$
nowhour = VAL(LEFT$(TIME$, 2))) 'the hour isolated from TIME$
nowminute = VAL(MID$(TIME$, 4, 2))) 'the minute isolated from TIME$
nowsecond = VAL(RIGHT$(TIME$, 2))) 'the second isolated from TIME$

I wanted something that finds the amount of time in seconds between two DATE$ and TIME$ variables gotten at different times and possibly dates. It seemed easy enough but I realized that there are many what ifs that came up while i was thinking about it, like: what if it is less than a day further but the year changed? How do you account for these? I just got kind of overwhelmed, if someone could figure this one out that would be wonderful. I scratched my old code but above I posted the variable definitions.

Posted on Mar 20, 2012, 2:34 PM

Respond to this message   

Return to Index

Response TitleAuthor and Date
Re: Help on Mar 21
 A ProblemRobert Partel on Mar 22
  HereZack on Mar 22
   * Thanks guys :)Robert Partel on Mar 22

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement