Parsing Epoch Timestamps using Prepare recipe

Solved!
jvijayakumar2
Level 3
Parsing Epoch Timestamps using Prepare recipe

I'm trying to achieve

 

 

mutate(DATE = as.POSIXct(TIMESTAMPS, origin = '1970-01-01', tz = 'UTC'))

 

 

 through prepare recipe and the Convert UNIX timestamp doesn't seem to give any data in the DATE column. Could someone help?

 

 

0 Kudos
1 Solution
AlexT
Dataiker

Hi @jvijayakumar2 ,

Can try to first add formulate step with:

  format("%.0f", my_column_name) then try to convert to timestamp again in your current recipe.

https://knowledge.dataiku.com/latest/kb/data-prep/prepare-recipe/How-to-remove-scientific-notation-i...

 

If that doesn't work you may want to save the column with something like : 

my_timestamp <- as.numeric(my_datetime) in your R recipe before the prepare recipe. 

 

 

View solution in original post

0 Kudos
2 Replies
AlexT
Dataiker

Hi @jvijayakumar2 ,

Can try to first add formulate step with:

  format("%.0f", my_column_name) then try to convert to timestamp again in your current recipe.

https://knowledge.dataiku.com/latest/kb/data-prep/prepare-recipe/How-to-remove-scientific-notation-i...

 

If that doesn't work you may want to save the column with something like : 

my_timestamp <- as.numeric(my_datetime) in your R recipe before the prepare recipe. 

 

 

0 Kudos
jvijayakumar2
Level 3
Author

Thanks, @AlexT ! The formulate step before applying the Convert UNIX processor helped.