Skip to content

Instantly share code, notes, and snippets.

@cheald
Created November 4, 2014 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheald/6af63b6969df3a3a1dec to your computer and use it in GitHub Desktop.
Save cheald/6af63b6969df3a3a1dec to your computer and use it in GitHub Desktop.
def test_zone_0000
assert_equal(true, Time.parse("2000-01-01T00:00:00Z").utc?)
assert_equal(true, Time.parse("2000-01-01T00:00:00-00:00").utc?)
assert_equal(false, Time.parse("2000-01-01T00:00:00+00:00").utc?)
assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
assert_equal(true, Time.parse("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
assert_equal(false, Time.parse("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 GMT").utc?)
assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 -0000").utc?)
assert_equal(false, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 +0000").utc?)
assert_equal(true, Time.rfc2822("Sat, 01 Jan 2000 00:00:00 UTC").utc?)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment