Skip to content

Instantly share code, notes, and snippets.

@mykecameron
Last active December 11, 2015 14:28
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 mykecameron/4614318 to your computer and use it in GitHub Desktop.
Save mykecameron/4614318 to your computer and use it in GitHub Desktop.
<% # assuming the times are stored in @time1 %>
<script>
$(document).ready(function(){
date = new Date(<%= @time1.iso8601 %>);
$('.my_timezone_container').html(date.toString());
});
// or maybe use moment
$(document).ready(function(){
date = moment(<%= @time1.iso8601 %>);
$('.my_timezone_container').html(date.format('mm/dd/yyyy hh:mm');
});
</script>
<div class="my_timezone_container"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment