Fixed datetime conversion problem