No commit activity in last 3 years
No release in over 3 years
A clock class for use with time of day
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.5.2
>= 0
 Project Readme

A Clockwork Ruby - A clock class for use with time of day.

clock = Clock.now
=>  5:28 PM

other_clock = Clock.new(13,3)
=>  1:03 PM

clock.hour
=> 17 
clock.min
=> 30 
clock.sec
=> 21 
clock.usec
=> 266631

clock.hour = 23
=> 23

Clock.from_i(12345)
=>  3:25 AM

Clock.now.to_i
=> 63393

clock == other_clock
=> false

clock > other_clock
=> true

# Takes same arguments as strftime
clock.strfclock('%H:%M:%S')
=> "17:30:21"

Credits

A Clockwork Ruby is maintained by Mike Taylor and is funded by BookRenter.com. Help provided by Michael Pearce, and Miguel Huibonhoa.

BookRenter.com Logo

Copyright

Copyright (c) 2012 Bookrenter.com. See LICENSE.txt for further details.