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 (2).weeks() + (2).hours() + (15).seconds() // => 1216815000 (1).week().fromNow().toDate() // => Fri Sep 22 2006 19:16:32 GMT+0200 (CEST) var date = [...]