Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Fellow community.
I'm getting data from a table and in a tMap i'm trying to convert the DATE(
2020-01-28 00:00:00
) to UNIX(1686200924
) and return it as integer.I can't find anything online, only libraries to import in the tJava, but i dont want that.
If any one know how to do this in the tMap variable expression would be great.
Thnx for any help.
Vader Out 💪.
Hi @kevin cork
After you extract the date from a table using a Date data type, try the following code on tMap:
row1.date_column.getTime() / 1000
However, I believe the return would be in long data type. Not an integer.
Hi @kevin cork
After you extract the date from a table using a Date data type, try the following code on tMap:
row1.date_column.getTime() / 1000
However, I believe the return would be in long data type. Not an integer.
Hello,
The data outputed can be read with double, float or long type.
Here is an example of reverse about converting a UNIX timestamp to a readable date.
Best regards
Sabrina
Thank you very much. This helped a lot.
Vader Out 💪.