Getting TimeStamp

Hi everyone,
I used CSV reader node to read a csv file which is regularly updated every 2 days.

And I would like to get that update date of the csv file and add into the output table as a column “TimeStamp” with format ‘%Y-%m-%d %H:%M:%S’.

Could you please advise me how to do so?
Thanks a lot for your help
Hanh

@HanhDo

I assume that you are talking about the timestamp of the file creation.
AFAIK it is not possible to get this information directly. But there might be a workaround

Hi @knimediger ,
I am actually talking about the timestamp of the csv file. For example, the csv file was updated latest on 2021-03-05 21:30:15 and I load it to KNIME on 2021-03-08 14:30:15. The timestamp I would like to get is 2021-03-05 21:30:15
I hope KNIME has something to support this.
Hanh

Hi HanhDo,

you can, there is in fact a dedicated node to it, the FIles/Folders Metadata node.

I have created a small example for you. What I did was to write the filepath in an empty table, convert it to data type of path and then extract the meta info through the aforementioned path.

See this mini workflow:

6 Likes

ahhhhh, I got it.
Thank you so so much for your kind help @kowisoft :smiley:
Best
Hanh

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.