From b7fc000f340f2be6f9c0e8f615aa4ae23ecf9d20 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Wed, 6 Jul 2011 08:35:31 -0400 Subject: Add client-side Basis.now and pretty-printing of times --- lib/js/urweb.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/js/urweb.js') diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 35a62d76..272ba32b 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -93,6 +93,19 @@ function length(ls) { } +// Time + +function showTime(tm) { + var newDate = new Date(); + newDate.setTime(tm / 1000); + return newDate.toUTCString(); +} + +function now() { + return (new Date()).getTime() * 1000; +} + + // Error handling function whine(msg) { -- cgit v1.2.3