1

Hello i would like to convert dates in this format /Date(1577746800000+0100)/ to simple date using CDAP. someone can help me? thanks

example of date

/Date(1577746800000+0100)/
/Date(1570572000000+0200)/
/Date(1558821600000+0200)/
/Date(1546297200000+0100)/
/Date(1546297200000+0100)/
nuxer
  • 17
  • 5

1 Answers1

1

You can achieve this by using wrangler. Since the data is of fixed length, we can extract the timestamp from the string. At the bottom of the screen, you see a console where you can type in instruction.

cut-character <column-name> <destination-column-name> 7-19

Then we can parse this column to date by:

parse-timestamp :<destination-column-name> 'milliseconds'

and finally format the result to a format that you like:

format-date :<destination-column-name> 'MM/dd/yyyy HH:mm'

Hope that helps!

Edwin Elia
  • 399
  • 3
  • 5