Convert Timestamp to Date

37 views
Skip to first unread message

damien henrotin

unread,
Nov 4, 2022, 7:54:56 AM11/4/22
to OpenRefine

Hi,

I have a number Timestamp to convert into UNIX date.

I try the solution give by Thad here : https://github.com/OpenRefine/OpenRefine/issues/608

Problem is: when I add my new column by fetching URL, percentage of work don't progress,, I think this API doesn't work anymore.

Can you confirm that ?

thanks

Owen Stephens

unread,
Nov 4, 2022, 8:06:46 AM11/4/22
to OpenRefine
Happily since 3.6 was released you can do this directly with the GREL

value.timeSinceUnixEpochToDate()

This works directly if the timestamp is in seconds since the unix epoch. If you have other units you can specify:
value.timeSinceUnixEpochToDate('second')
value.timeSinceUnixEpochToDate('millisecond')
value.timeSinceUnixEpochToDate('microsecond')

Best wishes

Owen 

damien henrotin

unread,
Nov 4, 2022, 8:15:28 AM11/4/22
to OpenRefine
Oh very nice. I need to upgrade my version. How I know if I should take with or without embedded JRE version ?

Owen Stephens

unread,
Nov 4, 2022, 10:33:40 AM11/4/22
to OpenRefine
If you aren't sure then probably best to take the one with embedded JRE as it means you don't have to worry about any separate installation of Java

Best wishes

Owen

Reply all
Reply to author
Forward
0 new messages