? Time seconds function thing ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Time seconds function thing

Prokuku wanted me to make a page for this.... 'Calculate number of seconds since 2000 DEF TIME() VAR H,M,S VAR Y,MO,D TMREAD OUT H,M,S DTREAD OUT Y,MO,D DEC D DEC MO INC S,M*60 INC S,H*60*60 VAR I FOR I=2000 TO Y-1 INC S,(365+ISLEAPYEAR(I))*60*60*24 NEXT INC S,DAYSINMONTH(Y,MO,D)*60*60*24 RETURN S END DEF ISLEAPYEAR(Y) RETURN Y MOD 4==0 && (Y MOD 100!=0 || Y MOD 400==0) END 'get days in a month (aaaaaaa) DEF DAYSINMONTH(Y,M,D) IF M==0 THEN RETURN D INC D,31 IF M==1 THEN RETURN D INC D,28+ISLEAPYEAR(Y) IF M==2 THEN RETURN D INC D,31 IF M==3 THEN RETURN D INC D,30 IF M==4 THEN RETURN D INC D,31 IF M==5 THEN RETURN D INC D,30 IF M==6 THEN RETURN D INC D,31 IF M==7 THEN RETURN D INC D,31 IF M==8 THEN RETURN D INC D,30 IF M==9 THEN RETURN D INC D,31 IF M==10 THEN RETURN D INC D,30 IF M==11 THEN RETURN D END
Author
12Me21
Updated
Rating
2 votes
Categories
Keywords
  • don't
  • read
  • this
  • page
  • aaaa
1 Comment(s) ProKuku ProKuku QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Night Person I like the quiet night and sleep late. Express Yourself Pokemon Is Awesome! I love Pokemon! Express Yourself 👍