Wouldn't it be easier to use date.utc instead ? It should also help to set date as integer instead of parsing it from a string