diff lib/js/urweb.js @ 1487:290de2dcecf6

Add client-side Basis.now and pretty-printing of times
author Adam Chlipala <adam@chlipala.net>
date Wed, 06 Jul 2011 08:35:31 -0400
parents ae7547789c73
children b2ca3e1e5b40
line wrap: on
line diff
--- a/lib/js/urweb.js	Sun Jul 03 16:50:17 2011 -0400
+++ b/lib/js/urweb.js	Wed Jul 06 08:35:31 2011 -0400
@@ -93,6 +93,19 @@
 }
 
 
+// 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) {