Manolait
Manolait

Reputation: 352

Pentaho kettle convert date to unix

I'm trying to pacha a string format dated "2019-05-14 13:30:00" to a UNIX format.

In javascript I got it but in the javascript kettle module I am not able to return the numeric value 1557833442

the line of code is this:

const tests = (new Date ("2019-05-14 13:30:00"). getTime () / 1000);

Upvotes: 0

Views: 372

Answers (1)

Cyrus
Cyrus

Reputation: 2195

It looks like the Date() constructor doesn't like the format you are using.

If you want the current date, use a Get System Info, it has a number of useful date options.

If you are converting an incoming field, use the Select Values step to change the metadata, using the format string that matches your string field's format.

Upvotes: 1

Related Questions