Changed time.valueOf() to time.getTime()