add class method toTime() in util.js