From http://yaniswang.com/frontend/2013/02/16/dateformat-performance/