       $(this).attr("title", null)
       $(this).text(this.long_text)
       delete this.long_text
+
+class TimeFormat
+  @formatTime = (timestamp) ->
+    new Date(parseInt(timestamp)).toLocaleTimeString()
+
+  @formatDate = (timestamp) ->
+    new Date(parseInt(timestamp)).toLocaleDateString()
+
+  @formatDateTime = (timestamp) ->
+    "#{@formatDate(timestamp)} #{@formatTime(timestamp)}"
  router.add("/logs/:base/*", (params) -> show_logs( params.base, params.splat ))
  router.add("/logs/:base", (params) -> show_log_root_base( params.base))
  router.paramVerifier = (s) -> /^[a-z0-9\/\-]+$/i.test(s)
  router.debug = true
  router.transparentRouting()
  window.router = router


  $.get "/logs/json/log/" + base + "/" + name + "/" + id, (data) ->
    clear()
    document.title = "Logs for " + base + "/" + name + "/" + id
    data.date = TimeFormat.formatDateTime(data.start * 1000)
    ignore_date = TimeFormat.formatDate(data.start * 1000)
    renderElements "#content", "#t-show-log",
      base: base
      name: name
