question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSV DateTime Export

See original GitHub issue

When doing a CSV export, datetime columns do not export properly. Run this query:

SELECT CAST('2017-09-18' AS DateTime) AS FIRST,
       CAST('2017-09-18' AS DateTime) AS SECOND,
       CAST('2017-09-18' AS DateTime) AS LAST

CSV gets exported like:

FIRST,SECOND,LAST
1505692800000,1505692800000,2017-09-18T00:00:00.000Z

DateTime fields will only be exported properly if it is the last column. JSON works as expected:

[
  {
    "FIRST": "2017-09-18T00:00:00.000Z",
    "SECOND": "2017-09-18T00:00:00.000Z",
    "LAST": "2017-09-18T00:00:00.000Z"
  }
]

Version: 1.20.2 DB: MSSQL

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tengiscommented, Oct 20, 2017

i’m using MSSQL and also i tested on master branch. Looks like all looking fine on mine.

FIRST,SECOND,LAST 2017-09-18T00:00:00.000Z,2017-09-18T00:00:00.000Z,2017-09-18T00:00:00.000Z

[ { "FIRST": "2017-09-18T00:00:00.000Z", "SECOND": "2017-09-18T00:00:00.000Z", "LAST": "2017-09-18T00:00:00.000Z" } ]

0reactions
msopko81commented, Oct 26, 2017

I tested with the latest release and this issue has been resolved.

Thank you,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exporting Date/Time fields via Export Data results in extra ...
Select the Export Data button on the toolbar. Select several fields, including the date/time fields.
Read more >
Formatting Dates for CSV Imports - Administration - Echo360
Basic steps: select the date column, right-click and select Format Cells, then select Custom and enter yyyy-mm-dd in the text field. Open the...
Read more >
Export Data from Dataverse Table (CSV) DateTime Co...
I have been exporting data from a dataverse table and a datetime column in Excel is a different data type. Some records are...
Read more >
Handling datetime from exported csv file - - MathWorks
I have both of my account profile and channel export time zones set to "(GMT+8000)Beijing". The datetime from the exported feeds.csv looks like:...
Read more >
MS Access export query with DateTime extended field to csv ...
Csv can't store a date variable, it will be a string.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found