comparison 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
comparison
equal deleted inserted replaced
1486:7f8ddcf12b20 1487:290de2dcecf6
88 88
89 for (; ls; ls = ls.next) 89 for (; ls; ls = ls.next)
90 ++acc; 90 ++acc;
91 91
92 return acc; 92 return acc;
93 }
94
95
96 // Time
97
98 function showTime(tm) {
99 var newDate = new Date();
100 newDate.setTime(tm / 1000);
101 return newDate.toUTCString();
102 }
103
104 function now() {
105 return (new Date()).getTime() * 1000;
93 } 106 }
94 107
95 108
96 // Error handling 109 // Error handling
97 110