Skip to content

Instantly share code, notes, and snippets.

@goooooouwa
Last active August 29, 2015 14:13
Show Gist options
  • Save goooooouwa/0494ac14f266efccb717 to your computer and use it in GitHub Desktop.
Save goooooouwa/0494ac14f266efccb717 to your computer and use it in GitHub Desktop.

Rule of thumb: Rails by default prints datetime in ISO8601 format in %Y-%m-%d %H:%M:%S +offset style, e.g. 2014-12-18 13:00:00 +1000 and encode datetime in JSON as standard_son_format, e.g. 2005-02-01T05:15:10.000-10:00

Angular formats datetime in timezone of the browser if timezone option of date filter is not specified.

Browsers format datetime string based on local date format settings. But browsers only support datetime-local picker.

With Rails datetime_local_field, the timezone is ignored, it outputs something like this <input type="datetime-local" value="1984-01-12T00:00:00" />.

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