8 filesupdated Jun 18, 2026
files6Download
./libJun 16, 2026./specJun 16, 2026init.rbJun 16, 2026install.rbJun 16, 2026LICENSEJun 16, 2026READMEJun 18, 2026README
Zoned
This plugin is the simplest way to add local times to your app.
Usage:
-
Call the javascript function Timezone.set() to set a timezone cookie
eg: Hook it into the authentication system
Logging in: <% form_for @login, { :html => { :onsubmit => "Timezone.set()" } %>
Logging out: cookies.delete(:timezone)
eg: Initialize it automatically
window.onload = Timezone.set
-
Use it: <%= z(@post.created_at).strtime("%D") %>
If cookies[:timezone] is set it will convert the time to the user's local time, otherwise it will do nothing.
You don't need to have AR save your time in UTC, the plugin will determine your server's offset and adjust accordingly.