Converting Java dates to Julian Dates

One Star

Converting Java dates to Julian Dates

how do you convert Java dates to julian dates using talend?
One Star

Re: Converting Java dates to Julian Dates

Hi Jamie,

After speaking directly, we found that Jamie was trying to convert longs (number of milliseconds since the epoch) to regular date fields.

In order to do this, we need to read the data in as a long, and then convert it to a date type. I used a tMap from the long to date (dont forget to set the date format in the schema to "MM/dd/yyyy"), and the transform expression for the date field is:

new Date(row1.LongDate)

output looks like:

1240001474750|04/17/2009
1240770188953|04/26/2009
1241957891640|05/10/2009
1242236149265|05/13/2009
1242070538187|05/11/2009
1242300633500|05/14/2009
1245587646531|06/21/2009
1245684007687|06/22/2009
1190027854328|09/17/2007

HTH,

Thomas