Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/internet_time.rb

Constant Summary collapse

BMT_OFFSET_SEC =

Biel Mean Time offset to UTC in seconds

3600

Instance Method Summary collapse

Instance Method Details

#beatsObject

Time in .beats



22
23
24
25
# File 'lib/internet_time.rb', line 22

def beats
  time = bmt
  ((time.hour * 60 + time.min) * 60 + time.sec) * 10 / 864
end

#bmtObject

Time in Biel Mean Time (UTC+1)



17
18
19
# File 'lib/internet_time.rb', line 17

def bmt
  utc + BMT_OFFSET_SEC
end

#to_beatsObject

Time in .beats, formatted



28
29
30
# File 'lib/internet_time.rb', line 28

def to_beats
  '@%03d' % beats
end