Solve the problem for safari that new Date(