Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have an Input which is "1900-01-01T00:00:00" that is a String and I need to convert it into epoch time which is long. How can I achieve this?
Hi,
Please refer the below logic.
I cross verified the answer and it looks same as below.
The function used is as shown below.
(TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss",row1.input_date).getTime())/1000
Please spare a second to mark the topic as resolved as it will help others during their reference 🙂
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hi,
Please refer the below logic.
I cross verified the answer and it looks same as below.
The function used is as shown below.
(TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss",row1.input_date).getTime())/1000
Please spare a second to mark the topic as resolved as it will help others during their reference 🙂
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hi Nikhil,
Thanks for your kind response and it helped to resolve the issue.
However, how to get the current local date into epoch time? What will be the function that I need to write in Expression Builder? Current Date Format would be ("yyyy-MM-dd"T"HH:mm:ss") that should be coverted into epoch time.
I would really appreciate your kind support. Thanks!
Hi,
Since current time is already in date format, could you please try below?
(TalendDate.getCurrentDate().getTime())/1000
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved