Thread: Time and MOD
View Single Post
  #5  
Old 12-20-2011, 11:33 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by sssssssssss View Post
It should be minutes, i changed it after posting. What would days, weeks and years mod by? i thought it was the number of seconds in them but i guess not. :x And for my learning, why 12 for hours?
7 days in a week, so maybe mod days by 7. Approximately 52 weeks in a year, so I'd mod by 52 (although who reports weeks?). Don't mod years. There's no limit for years... I mean unless you want to do decades or millenia or something...
12 (or 24) is for hours in a day. You've already converted from seconds to hours (by dividing by 3600), so you're now working with FULL hours, which you want to cap at 12 (or 24). I think 24 is more appropriate for what you're trying to do here, so mod by 24 (because there are 24 in a day, you know).

e: I didn't read carefully, I thought you were reporting clock time, so the int(x-1)%m+1 hack isn't necessary.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/

Last edited by Tolnaftate2004; 12-20-2011 at 11:39 PM.. Reason: Wow, did I completely forget what grammar is? x-x
Reply With Quote