Format datetime
Fix invalid date passed as String