Created
May 12, 2011 20:43
-
-
Save tanelsuurhans/969400 to your computer and use it in GitHub Desktop.
Date and time inconsistencies
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 :005 > Date.today.to_time | |
| => 2011-05-12 00:00:00 +0300 | |
| ruby-1.9.2-p180 :006 > Date.today.to_datetime | |
| => Thu, 12 May 2011 00:00:00 +0000 | |
| ruby-1.9.2-p180 :007 > Date.today.to_time_in_current_zone | |
| => Thu, 12 May 2011 00:00:00 EDT -04:00 | |
| ruby-1.9.2-p180 :008 > Time.zone | |
| => (GMT-05:00) Eastern Time (US & Canada) | |
| ruby-1.9.2-p180 :009 > Time.now | |
| => 2011-05-12 23:43:28 +0300 | |
| ruby-1.9.2-p180 :010 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment