From 226fb11ff2da90b7b68dad1b29b9688f880a06a3 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 4 Dec 2011 14:40:12 -0500 Subject: timeFormat .urp directive --- lib/js/urweb.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/js') diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 5f1566a3..c6e55907 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -114,11 +114,14 @@ function round(n) { // Time, represented as counts of microseconds since the epoch +var time_format = "%c"; + function showTime(tm) { - var newDate = new Date(); - newDate.setTime(tm / 1000); - var r = newDate.toUTCString(); - return r; + return strftime(time_format, tm); +} + +function showTimeHtml(tm) { + return eh(showTime(tm)); } function now() { -- cgit v1.2.3