Fix datetime creation from format