I’ve ported Rails’ Numeric Time extensions to JavaScript since I needed to do some date calculations for a project I’m working on. Now one should be able to calculate dates in JS like this: (5).seconds() // => 5000<br /> (2).weeks() + (2).hours() + (15).seconds() // => 1216815000<br /> (1).week().fromNow().toDate() // => Fri Sep 22 2006 19:16:32 GMT+0200 (CEST)<br /> var date = new Date(2000, 11,