Advertisement
Serafim

Untitled

Feb 10th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace Time:
  2.   class Segment
  3.     constructor: (@seconds) ->
  4.     getSeconds: ->  if (t = ((@seconds)>>0)%(60))<10 then '0' + t else t
  5.     getMinutes: ->  if (t = ((@seconds/60)>>0)%(60))<10 then '0' + t else t
  6.     getHours: ->    if (t = ((@seconds/60/60)>>0)%(60))<10 then '0' + t else t
  7.     getDays: ->     if (t = ((@seconds/60/60/24)>>0)%(60))<10 then '0' + t else t
  8.     getMonths: (daysPerMonth = 30) ->   if (t = ((@seconds/60/60/24/daysPerMonth)>>0)%(60))<10 then '0' + t else t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement