You are not logged in.
Announcement
Unanswered posts
|
Thanks
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
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