Fix datetime issue