-
-
Save mrchrisadams/108115 to your computer and use it in GitHub Desktop.
This file contains 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
>> e = DateTime.strptime('2009-05-07T01:33:23+01:00') | |
=> Thu, 07 May 2009 01:33:23 0100 | |
>> f = DateTime.strptime('2009-05-06T23:33:23+01:00') | |
=> Wed, 06 May 2009 23:33:23 0100 | |
>> e - f | |
=> Rational1, 12 | |
>> a = Time.now | |
=> Thu May 07 10:25:53 -0400 2009 | |
>> b = Time.now | |
=> Thu May 07 10:25:57 -0400 2009 | |
>> b - a | |
=> 3.711893 | |
>> a = User.first.created_at | |
=> Wed, 26 Nov 2008 00:10:44 UTC +00:00 | |
>> b = User.last.created_at | |
=> Sat, 25 Apr 2009 06:32:05 UTC +00:00 | |
>> b - a | |
=> 12982881.0 | |
# example with the to time: | |
>> e.to_time | |
=> Thu, 07 May 2009 01:33:23 0100 | |
>> e.to_time - f.to_time | |
=> Rational1, 12 | |
>> z = (e.to_time - f.to_time) | |
=> Rational1, 12 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment