Module | N::TimeUtils |
In: |
lib/glue/time.rb
|
General time utilities collection
Implement as a module to avoid class polution. You can still Ruby‘s advanced features to include the module in your class. Passing the object to act upon allows to check for nil, which isn‘t possible if you use self.
NOW | = | Time.now |
NEVER | = | Time.mktime(2038) |
ZERO | = | Time.mktime(1972) |
This method calculates the days extrema given two time objects. start time is the given time1 at 00:00:00 end time is the given time2 at 23:59:59:999
Input:
Output