Hi,
I am using system.tag.queryTagHistory to get the historian values of certain tags.
But when i try to export the table to csv, i noticed that t_stamp format is displaying as below,
only when clicking on cell, full datetime is getting displayed. Any suggestions to overcome this?
pturmel
January 20, 2023, 12:44pm
2
Format the column in the spreadsheet. Or open the CSV in a text editor. (Your spreadsheet program is doing this, not Ignition.)
Or, better yet, don't use CSV if you are going to open in a spreadsheet program. Use the Excel export tools instead.
This is an Excel issue, not an Ignition issue. That said, Excel is very, very bad at this. EDIT: Phil beat me to that point.
Unfortunately, even using the built-in functions, Excel rarely uses a useful format.
I updated this function to allow an arbitrary date format, or use the deafult 'yyyy-MM-dd HH:mm:ss'.
The Apache POI libraries are included with Ignition. At the time I was only needing to read files, so xlrd was all that was necessary.
I'm just starting to dig into POI, myself, but here's a start:
EDIT 2021-08-23: Updated to allow JsonDataSets. Changed to allow for a ByteArray output instead of writing to a file.
EDIT 2023-01-20: Added option for date formats. Default is 'yyyy-MM-dd hh:mm:ss'.
EDIT 2023-05-12: Added options for first row and column, if needed to offset from A1
def datasetT…
1 Like