Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on September 20, 2022 8:42AM
Likes: 0
Replies: 3
Hi,
can anyone please help on the below output date format for lastModified metric, as i am seeing the value is too large and wondering what would the format would be here? , output = 1658217052750
dataiku.Dataset("*", project_key='*', ignore_flow=False).get_files_info()
Hi Sunith,
That UNIX epoch timestamp is in milliseconds.
If converted to a timestamp this file was last modified on: GMT: Tuesday, 19 July 2022 07:50:52.750
Hi @sunith992
, to add to @MiguelangelC
's response, here is how I convert unix epoch times to local time:
import dataiku import datetime ds_last_modified_unix_epoch = dataiku.Dataset("DS_NAME").get_config()['versionTag']['lastModifiedOn'] dtm = datetime.datetime.fromtimestamp(ds_last_modified_unix_epoch / 1000) print(dtm.strftime('%Y-%m-%d %H:%M:%S.%f'))
To return UTC / GMT time, use utcfromtimestamp instead of fromtimestamp.
Marlan
Hi Marlan,
Got it, Thanks for the below solution.