Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Created January 5, 2012 03:00
Show Gist options
  • Save mgreenly/1563503 to your computer and use it in GitHub Desktop.
Save mgreenly/1563503 to your computer and use it in GitHub Desktop.
t = DateTime.parse("2011/01/01T00:00") + (Time.now.getlocal.utc_offset * -1).seconds
# Sat, 01 Jan 2011 06:00:00 +0000
t.to_time.localtime
# 2011-01-01 00:00:00 -0600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment