fix datetime conversion