Timestamp format changes when I export data from a table to excel


I have table data with a timestamp in the format of MMM dd, yyyy hh:mm a. When I export that table data to excel it comes in at hh:mm.s. I do all of the conversion in python. Is there anyway to adjust the way this imports so that the timestamp format stays the same?

Here is the code I am using:

component = event.source.parent.getComponent('Table')
csv = system.dataset.toCSV(component.data)
Filepath = system.file.openFile('csv','C:\\')
system.file.writeFile(Filepath, csv)

It fixed itself. I don’t know why but I am not going to question it.

Depending on the excel version you have, a lot of times excel will automatically interpret the data and choose the “best” format for it. Pretty annoying sometimes. I believe you can alter it or turn it off in settings somewhere. not sure this was the cause, but very possible.

1 Like