--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: periods
comment: 
- !ruby/struct:SM::Flow::P 
  body: Converts a time in the local timezone to UTC. local can either be a DateTime, Time or timestamp (Time.to_i). The returned time has the same type as local. Any timezone information in local is ignored (it is treated as a local time).
- !ruby/struct:SM::Flow::P 
  body: "Warning: There are local times that have no equivalent UTC times (e.g. in the transition from standard time to daylight savings time). There are also local times that have more than one UTC equivalent (e.g. in the transition from daylight savings time to standard time)."
- !ruby/struct:SM::Flow::P 
  body: In the first case (no equivalent UTC time), a PeriodNotFound exception will be raised.
- !ruby/struct:SM::Flow::P 
  body: In the second case (more than one equivalent UTC time), an AmbiguousTime exception will be raised unless the optional dst parameter or block handles the ambiguity.
- !ruby/struct:SM::Flow::P 
  body: If the ambiguity is due to a transition from daylight savings time to standard time, the dst parameter can be used to select whether the daylight savings time or local time is used. For example,
- !ruby/struct:SM::Flow::VERB 
  body: "  Timezone.get('America/New_York').local_to_utc(DateTime.new(2004,10,31,1,30,0))\n"
- !ruby/struct:SM::Flow::P 
  body: would raise an AmbiguousTime exception.
- !ruby/struct:SM::Flow::P 
  body: Specifying dst=true would return 2004-10-31 5:30:00. Specifying dst=false would return 2004-10-31 6:30:00.
- !ruby/struct:SM::Flow::P 
  body: If the dst parameter does not resolve the ambiguity, and a block is specified, it is called. The block must take a single parameter - an array of the periods that need to be resolved. The block can return a single period to use to convert the time or return nil or an empty array to cause an AmbiguousTime exception to be raised.
full_name: TZInfo::Timezone#local_to_utc
is_singleton: false
name: local_to_utc
params: (local, dst = nil) {|periods| ...}
visibility: public
