'=========================================================================== ' Subject: SECONDS LEFT UNTIL YEAR 2000 Date: 07-25-99 (12:02) ' Author: Laz500@aol.com Code: QB, QBasic, PDS ' Origin: santa@tir.com Packet: DATETIME.ABC '=========================================================================== ' Ί Millenium Ί ' ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ ' ' E-Mail: Graham_Lally@o14amiga.demon.co.uk ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ ' Or: Laz500@aol.com Ί²²²²²²²²²²²²²²²² ' Ί±±±±±±±±±±±±±±±± ' WWW: http://www.kingston.ac.uk/~lr_s536/Qbasic.html Ί°°°°°°°°°°°°°°°° 'ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ DIM total.secs.left AS LONG 'to stop getting those nasty E numbers :] Year = VAL(RIGHT$(DATE$, 4)) '\ month = VAL(LEFT$(DATE$, 2)) ' \ day = VAL(MID$(DATE$, 4, 2)) ' Gets the values from the Date$ and Time$. ' The VAL just turns what is usually a Hours = VAL(LEFT$(TIME$, 2)) ' string into a number. Pretty useful... Mins = VAL(MID$(TIME$, 4, 2)) ' / Secs = VAL(RIGHT$(TIME$, 2)) '/ Years.left = (1999 - Year) * 365 * 24 * 60 * 60 'The above line works out the number of seconds in the years left. 'This next SELECT works out how many days have gone past in the completed 'months of this year. SELECT CASE month CASE 1: daysgone = 0 CASE 2: daysgone = 31 CASE 3: daysgone = 59 CASE 4: daysgone = 90 CASE 5: daysgone = 120 CASE 6: daysgone = 151 CASE 7: daysgone = 181 CASE 8: daysgone = 212 CASE 9: daysgone = 243 CASE 10: daysgone = 273 CASE 11: daysgone = 304 CASE 12: daysgone = 334 END SELECT daysgone = daysgone + day 'Now we add the number of days gone in this month. Days.left = (364 - daysgone) * 24 * 60 * 60 'And work out the seconds... Hours.left = (23 - Hours) * 60 * 60 Mins.left = (59 - Mins) * 60 Secs.left = (60 - Secs) 'Yep, all pretty straightforward... total.secs.left = Years.left + Days.left + Hours.left + Mins.left + Secs.left 'Add it all up... PRINT PRINT "Seconds left till the Year 2000:"; COLOR 14 PRINT total.secs.left PRINT COLOR 7 'And print it. All done. Easy peasy pudding and pie.