fixed bug where datetime picker was getting wrong format