title: In Ruby or Rails, what is the best way to convert Eastern Time to UTC?
body: <p>I'm not referring to </p>
  
  <pre><code>myDateTime = DateTime.now
  myDateTime.new_offset(Rational(0, 24))
  </code></pre>
  
  <p>or </p>
  
  <pre><code>Time.now.utc
  </code></pre>
  
  <p>What I have is a text date is given in Eastern Time.</p>
  
  <p>I can convert that text date into a DateTime. Let's call it <code>eastern_date_time</code>.</p>
  
  <p>Now, we have a variable containing an DateTime, but nothing knows it's eastern besides us. Converting it ourselves would be quite onerous. If the date in Daylight Savings Time (DST) (March 8 to November 1st this year), we'd have to add 4 hours to our eastern_date_time var to get UTC, and if the date is in Standard Time (ST) we'd have to add 5 hours to our eastern_date_time variable.</p>
  
  <p>How can we specify that what we have is an Eastern DateTime, and then convert it to UTC... something that will determine if the date is in the DST/ST, and apply the 4 or 5 hours properly?</p>
  
  <p>I want to convert any sort of date I get into UTC, for storage in my database. </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Using `in_time_zone', I'm unable to convert my Eastern Text Time to UTC. How can I achieve that objective? For example...</p>
  
  <pre><code>text_time = "Nov 27, 2015 4:30 PM" #given as Eastern
  myEasternDateTime = DateTime.parse text_time # =&gt; Fri, 27 Nov 2015 16:30:00 +0000 
  #now we need to specify that this myEasternDateTime is in fact eastern. However, it's our default UTC. If we use in_time_zone, it just converts the date at UTC to Eastern
  myEasternDateTime.in_time_zone('Eastern Time (US &amp; Canada)') # =&gt; Fri, 27 Nov 2015 11:30:00 EST -05:00 
  myEasternDateTime.utc # =&gt; Fri, 27 Nov 2015 16:30:00 +0000 
  </code></pre>
  
  <p>That's not what we want. We have to specify that myEasterDateTime is in fact eastern... so that when we do a <code>myEasterDateTime.utc</code> on 16:30:00 we end up getting 20:30:00.</p>
  
  <p>How can I accomplish this?</p>