zemirco / json2csv

Convert json to csv with column titles
http://zemirco.github.io/json2csv
MIT License
2.71k stars 365 forks source link

returns as unwanted date format. #334

Closed ohoroyoi closed 5 years ago

ohoroyoi commented 5 years ago

json2csv version 4.3.0

date_format1 here is my mysql. (mysql Ver 15.1 Distrib 5.5.59-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 )

date_format and here is my downloaded csv file using json2csv. I'd like it returned only to the year and date. But it returns timezone by default.

juanjoDiaz commented 5 years ago

I'm not sure how the data is retrieved from MySQL and passed to json2csv but it seems to me like it's a date. In Javascript there is no separate time and date. so the date is serialized in the standard JSON format.

You could preprocess each row to stringify each row in whatever format you want. Or use the fields option for that.

Does this help?

ohoroyoi commented 5 years ago

yes thanks! it was about mysql connection options.