Format datetime JSON properly