Create time.js

http://segmentfault.com/blog/zasqw2222/1190000002429528