Skip to content

Instantly share code, notes, and snippets.

@ice799
Created March 31, 2010 23:41
Show Gist options
  • Save ice799/351104 to your computer and use it in GitHub Desktop.
Save ice799/351104 to your computer and use it in GitHub Desktop.
irb(main):021:0> Time.now.zone
=> "UTC"
irb(main):022:0> Time.now.utc?
=> false
### and also:
irb(main):005:0> Time.now.iso8601
=> "2010-03-31T23:46:20+00:00"
irb(main):006:0> Time.now.utc.iso8601
=> "2010-03-31T23:46:24Z"
### ?
@abhay
Copy link

abhay commented Mar 31, 2010

irb(main):013:0> Time.now
=> Wed Mar 31 23:52:23 +0000 2010

irb(main):014:0> Time.now.gmtime
=> Wed Mar 31 23:52:26 UTC 2010

irb(main):015:0> Time.now.utc?
=> false

irb(main):016:0> Time.now.gmtime.utc?
=> true

@abhay
Copy link

abhay commented Mar 31, 2010

$ jirb

irb(main):001:0> Time.now
=> Wed Mar 31 23:55:24 UTC 2010

irb(main):002:0> Time.now.gmtime
=> Wed Mar 31 23:55:27 UTC 2010

irb(main):003:0> Time.now.utc?
=> true

irb(main):004:0> Time.now.gmtime.utc?
=> true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment