I recently had to export a table from MS SQL Server that had individual date and time columns. sqltocsv exports both columns as time stamps (date + time). The resulting date column in CSV has 2018-05-02 00:00:00 +0000 UTC and time column is 0001-01-01 13:24:02 +0000 UTC.
The attached sqltocsv.go file has a crude hack that formats the results as time if the date is null (0001-01-01) and as date if otherwise.
There are definitely better ways to do this, but it worked for me. Hope this is useful to someone.
sqltocsv.go.txt
I recently had to export a table from MS SQL Server that had individual
dateandtimecolumns.sqltocsvexports both columns as time stamps (date + time). The resulting date column in CSV has2018-05-02 00:00:00 +0000 UTCand time column is0001-01-01 13:24:02 +0000 UTC.The attached sqltocsv.go file has a crude hack that formats the results as time if the date is null (0001-01-01) and as date if otherwise.
There are definitely better ways to do this, but it worked for me. Hope this is useful to someone.
sqltocsv.go.txt