Flowdock
method

parse

Importance_1
Ruby on Rails latest stable (v4.0.2) - 0 notes - Class: TimeZone
  • 1.0.0
  • 1.1.1
  • 1.1.6
  • 1.2.0
  • 1.2.6
  • 2.0.0
  • 2.0.3
  • 2.1.0 (0)
  • 2.2.1
  • 2.3.2
  • 2.3.8
  • 3.0.0
  • 3.0.5
  • 3.0.9
  • 3.1.0
  • 3.2.1
  • 3.2.3
  • 3.2.8
  • 3.2.13
  • 4.0.2
  • What's this?
parse(str, now=now) public

Method for creating new ActiveSupport::TimeWithZone instance in time zone of self from parsed string. Example:

  Time.zone = "Hawaii"                      # => "Hawaii"
  Time.zone.parse('1999-12-31 14:00:00')    # => Fri, 31 Dec 1999 14:00:00 HST -10:00

If upper components are missing from the string, they are supplied from TimeZone#now:

  Time.zone.now                 # => Fri, 31 Dec 1999 14:00:00 HST -10:00
  Time.zone.parse('22:30:00')   # => Fri, 31 Dec 1999 22:30:00 HST -10:00
Show source
Register or log in to add new notes.