Method: Lazier::DateTime::ClassMethods#parameterize_zone

Defined in:
lib/lazier/datetime.rb

#parameterize_zone(tz, with_offset = true) ⇒ String

Returns a string representation of a timezone.

DateTime.parameterize_zone(ActiveSupport::TimeZone["Pacific Time (US & Canada)"])
# => "-0800@pacific-time-us-canada"

Parameters:

  • tz (TimeZone)

    The zone to represent.

  • with_offset (Boolean) (defaults to: true)

    If to include offset into the representation.

Returns:

  • (String)

    A string representation which can be used for searches.



93
94
95
# File 'lib/lazier/datetime.rb', line 93

def parameterize_zone(tz, with_offset = true)
  ::ActiveSupport::TimeZone::parameterize_zone(tz, with_offset)
end