Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/tod/date.rb
Instance Method Summary collapse
-
#at(time_of_day, time_zone = Tod::TimeOfDay.time_zone) ⇒ Object
Returns a local Time instance with this date and time_of_day Pass in time_zone to use ActiveSupport::TimeZone.
- #to_time_of_day ⇒ Object
Instance Method Details
#at(time_of_day, time_zone = Tod::TimeOfDay.time_zone) ⇒ Object
Returns a local Time instance with this date and time_of_day Pass in time_zone to use ActiveSupport::TimeZone
4 5 6 |
# File 'lib/tod/date.rb', line 4 def at(time_of_day, time_zone=Tod::TimeOfDay.time_zone) time_zone.local year, month, day, time_of_day.hour, time_of_day.minute, time_of_day.second end |
#to_time_of_day ⇒ Object
8 9 10 |
# File 'lib/tod/date.rb', line 8 def to_time_of_day TimeOfDay.new hour, minute, second end |