Thanks for the article. I am pleased to read this as I actually did the exact same thing recently in Javascript while I was working on a time sensitive feature. I basically created a function that takes now and tested it very well and use an other (untested) function in the system passing new Date(). I like the simplicity and testability of the solution.