Class Time
In: lib/facet/times.rb
Parent: Object

Convenience methods for Time class

Methods

Public Instance methods

Returns a new Time representing the time a number of seconds ago. Do not use this method in combination with x.months, use months_ago instead!

at_beginning_of_day()

Alias for beginning_of_day

at_beginning_of_month()

Alias for beginning_of_month

at_beginning_of_week()

Alias for beginning_of_week

at_beginning_of_year()

Alias for beginning_of_year

at_midnight()

Alias for beginning_of_day

Returns a new Time representing the start of the day (0:00)

Returns a new Time representing the start of the month (1st of the month, 0:00)

Returns a new Time representing the "start" of this week (Monday, 0:00)

Returns a new Time representing the start of the year (1st of january, 0:00)

in(seconds)

Alias for since

Short-hand for months_ago(1)

Short-hand for months_ago(1)

midnight()

Alias for beginning_of_day

monday()

Alias for beginning_of_week

Returns a new Time representing the time a number of specified months ago.

Short-hand for months_since(1)

Returns a new Time representing the start of the given day in next week (default is Monday).

Short-hand for months_since(1)

Seconds since midnight: Time.now.seconds_since_midnight

Returns a new Time representing the time a number of seconds since the instance time. Do not use this method in combination with x.months, use months_since instead!

Convenience method which returns a new Time representing the time 1 day since the instance time

Returns a new Time representing the time a number of specified years ago.

Convenience method which returns a new Time representing the time 1 day ago

[Validate]