Skip to content

exporting individual date and time columns #9

Description

@rsubr

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions