Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert from UTC datetime format to datetime

I have this field in my xml input <IssueDate>2018-02-08 "T" 14:22:25</IssueDate>. I want to insert to mssql database with datetime format (i.e 2018-02-08 14:22:25.0000000). How can i parseDate in talend? in what string format? TalendDate.parseDate("yyyy-MM-dd 'T' HH:mm:ss", [row1.PurchaseOrdersFeed:/PurchaseOrdersFeed/PurchaseOrders/PurchaseOrder/Header/IssueDate])  => this is not working

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I remove "T" from String. And it works now.

 

TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", StringHandling.EREPLACE([row1.PurchaseOrdersFeed:/PurchaseOrdersFeed/PurchaseOrders/PurchaseOrder/Header/IssueDate]," \"T\"","") )

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi @JaRoi ,

 

Please find the code snippet for your requirement in tJava.

 

Date d1 = TalendDate.parseDate("yyyy-MM-dd 'T' HH:mm:ss", "2018-02-08 T 14:22:25");

System.out.println("Formatted Date : "+TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.SSSSSS", d1));

 

Thanks and Regards,

Subhadip

Anonymous
Not applicable
Author

I used xml map. I got error "The method parseDate(String, String) in the type TalendDate is not applicable for the arguments (String, Date)" in code. 

outOrderTable_tmp.OrderDate = TalendDate
.parseDate(
"yyyy-MM-dd 'T' HH:mm:ss",
treeNodeAPI_tXMLMap_1_TXMLMAP_OUT
.get_Date(
"row1.PurchaseOrdersFeed:/PurchaseOrdersFeed/PurchaseOrders/PurchaseOrder/Header/IssueDate",
"dd-MM-yyyy"));
;

 

Anonymous
Not applicable
Author

I remove "T" from String. And it works now.

 

TalendDate.parseDate("yyyy-MM-dd HH:mm:ss", StringHandling.EREPLACE([row1.PurchaseOrdersFeed:/PurchaseOrdersFeed/PurchaseOrders/PurchaseOrder/Header/IssueDate]," \"T\"","") )