Mercurial > urweb
comparison lib/js/urweb.js @ 1514:3c0803c1acd7
Backpedal on tutorial-motivated urweb-mode changes; add Basis.diffInSeconds and Basis.toSeconds
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 22 Jul 2011 15:39:38 -0400 |
parents | b2ca3e1e5b40 |
children | 883347f5c3c2 |
comparison
equal
deleted
inserted
replaced
1513:5616b2cbdcdb | 1514:3c0803c1acd7 |
---|---|
101 return newDate.toUTCString(); | 101 return newDate.toUTCString(); |
102 } | 102 } |
103 | 103 |
104 function now() { | 104 function now() { |
105 return (new Date()).getTime() * 1000; | 105 return (new Date()).getTime() * 1000; |
106 } | |
107 | |
108 function diffInSeconds(tm1, tm2) { | |
109 return Math.round((tm2 - tm1) / 1000000); | |
110 } | |
111 | |
112 function toSeconds(tm) { | |
113 return Math.round(tm / 1000000); | |
106 } | 114 } |
107 | 115 |
108 | 116 |
109 // Error handling | 117 // Error handling |
110 | 118 |