Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

djugal
2012-05-12 04:59:16

Thanks

tmaurin
2012-05-11 22:21:37

Your date "2012-05-10" doesn't correspont to patten "yyyy-MM-dd HH:mm:ss"

try somthing like this :

!Relational.ISNULL(row1.dtu)?
   row1.dtu.length() == 19 ?
   TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row1.dtu)
   : TalendDate.parseDate("yyyy-MM-dd",row1.dtu)
:null

djugal
2012-05-11 13:15:49

Hi,
i have a conversion to make from string to date

my input string comes in any format numeric or any "yyyy-MM-dd HH:mm:ss" or "yyyy-MM-dd" "MM-dd-yyyy" etc

in my tmap filter i filter out the column for invalid data using
TalendDate.isDate(row16.string1,"yyyy-MM-dd HH:mm:ss") or
(TalendDate.isDate(row16.dtu,"yyyy-MM-dd")

in the tmap expression for the output date column i put
!Relational.ISNULL(row1.dtu)?
TalendDate.parseDate("yyyy-MM-dd HH:mm:ss",row1.dtu)
:null

this works for "yyyy-MM-dd HH:mm:ss" but not for "yyyy-MM-dd"

i get the error unparsable date "2012-05-10"


any help would be appreciated

regards,
djugal

Board footer

Powered by FluxBB