fix to_json method for timestamp data types