Quote:
Originally Posted by sssssssssss
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.