You should probably also support a `Date` object. just throw in a `time = isNaN(time) ? time.getTime() : time`.