Fixed datetime conversion