Created
June 1, 2011 20:04
-
-
Save plentz/1003175 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.9.2-p180 :002 > require 'time' | |
=> true | |
ruby-1.9.2-p180 :003 > Time.now.httpdate | |
=> "Wed, 01 Jun 2011 20:03:43 GMT" | |
ruby-1.9.2-p180 :004 > puts Time.httpdate("Wed, 01 Jun 2011 20:03:43 GMT") | |
2011-06-01 17:03:43 -0300 | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
O Ruby converte pro teu timezone no to_s da classe Time.
Se tu usares Time.httpdate("Wed, 01 Jun 2011 20:03:43 GMT").utc vai retornar a data no fuso horário GMT.