You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hi,
I have a string like that "16/01/2008 09:04:12 AM" and i need to have a date from this string.
i try with TalendDate.parseDate("dd/MM/yyyy HH:mm:ss aa", madate) but it doesn't work.
the log is Unparseable date: "16/01/2008 09:04:12 AM"
Have u got an idea to help me ?
Offline

I tried your date string with your format and it works for me. Maybe you have problems with your Locale.
For a quick test just generate a date with your format and make a visual compare.
Bye
Volker
Offline
Hi besco
Try this method:
TalendDate.parseDateLocale("dd/MM/yyyy HH:mm:ss aa",mydate,"EN")
Best regards
shong
Offline

it's ok now but another problem appears when i load my date in oracle. if i have 2 date like that
16/01/2008 09:04:12 AM
16/01/2008 09:04:12 PM
there's no difference in oracle.
About date, i've another question, how can i put a default value (date of day) for a oracle column.
i try in a tmap to put this
row1.ORIGINAL_FILE_DATE.equals("null") ? TalendDate.getDate("dd/MM/yyyy hh:mm:ss") : row1.ORIGINAL_FILE_DATEand the syntax seems to be wrong.
thanks to help me!
Offline
Hello
row1.ORIGINAL_FILE_DATE.equals("null") ? TalendDate.getDate("dd/MM/yyyy hh:mm:ss") : row1.ORIGINAL_FILE_DATE
There is no wrong on the syntax, if there are some fileds are empty in Oracle table, you can try this code:
row1.ORIGINAL_FILE_DATE==null ? TalendDate.getDate("dd/MM/yyyy hh:mm:ss") : row1.ORIGINAL_FILE_DATEBest regards
shong
Offline
Hi
What's the schema type of row1.ORIGINAL_FILE_DATE in your case? I thought it was string, not Date.
If it is a Date type, we should parse a string to a Date.
row1.ORIGINAL_FILE_DATE==null ? TalendDate.parseDate("dd/MM/yyyy hh:mm:ss",TalendDate.getDate("dd/MM/yyyy hh:mm:ss") ): row1.ORIGINAL_FILE_DATEBest regards
shong
Offline
Shong
I am getting the following error when I tried using the expression in tMap, row1.START_DATE_ACTIVE==null ? TalendDate.parseDate("dd/MM/yyyy hh:mm:ss",TalendDate.getDate("dd/MM/yyyy hh:mm:ss") ): row1.START_DATE_ACTIVE.
ErrorMessage:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Can you please let me know how I can avoid this error. Thanks in advance.
-Venkat
Offline
hi,
how to convert string to date in tmap
my string is "06/04/2010" but its give a error
java .lang .numberformatexception
regards,
naveen

Please see:
http://download.oracle.com/javase/1.4.2 … ormat.html
for all your date formatting needs.
Offline

I tried the same with variable type as date and expression as
TalendDate.parseDate("dd/MM/yyyy HH:mm:ss",row1.Target_Resolution_Date)
where row1.Target_Resolution_Date is of type string
in tMap component but i faced the following error
Exception in component tMap_1
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "13 12 2011 06:00:00"
at routines.TalendDate.parseDate(TalendDate.java:643)
at honey.create_my_first_job_0_1.Create_My_First_Job.tFileInputExcel_3Process(Create_My_First_Job.java:1566)
at honey.create_my_first_job_0_1.Create_My_First_Job.runJobInTOS(Create_My_First_Job.java:2312)
at honey.create_my_first_job_0_1.Create_My_First_Job.main(Create_My_First_Job.java:2186)
Caused by: java.text.ParseException: Unparseable date: "13 12 2011 06:00:00"
at java.text.DateFormat.parse(DateFormat.java:354)
at routines.TalendDate.parseDate(TalendDate.java:641)
... 3 more
[statistics] disconnected
Job Create_My_First_Job ended at 12:58 18/01/2012. [exit code=1]
Offline

hi i want to convert string 7/17/2012 2:57:16 PM to date but it gives error
Exception in component tMap_2
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "7/17/2012 2:57:16 PM"
at routines.TalendDate.parseDateLocale(TalendDate.java:676)
at xml_to_mysql.xml_master_data_conversion_0_1.Xml_Master_Data_Conversion.tFileInputXML_4Process(Xml_Master_Data_Conversion.java:6989)
at xml_to_mysql.xml_master_data_conversion_0_1.Xml_Master_Data_Conversion.runJobInTOS(Xml_Master_Data_Conversion.java:8194)
at xml_to_mysql.xml_master_data_conversion_0_1.Xml_Master_Data_Conversion.main(Xml_Master_Data_Conversion.java:8062)
Caused by: java.text.ParseException: Unparseable date: "7/17/2012 2:57:16 PM"
at java.text.DateFormat.parse(DateFormat.java:337)
at routines.TalendDate.parseDateLocale(TalendDate.java:674)
... 3 more
[statistics] disconnected
Regards,
naveen
Offline

Hi
I have this problem with the convertion of a data String type to Date.
I have this value 2012-04-26T18:27:55, and i want to convert it to a Date data type
I need this format dd/mm/yyyy
This is the error message that is returnig:
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "2012-04-26T18:27:55
Offline
Pages: 1