Write proper date to json file