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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
TalendBasketball65
Contributor
Contributor

Changing Month from English to French

Hi All,

This is probably a simple quick fix. I have a tfileinputdelimited(.csv file) that contains dates that are English (September 03, 2020). I need to convert it to French example(septembre 3 2020) format. What's the easiest way to approach this? I also forgot to include that I have code that indicate French or English so that would be taken into account.

Thanks,

Labels (2)
1 Reply
cadap
Contributor III
Contributor III

You could create a user-routine, which converts English to French Dates in your above format like this:

 

public static String English2French(String dateString){

DateTimeFormatter formatterEnglish = DateTimeFormatter.ofPattern("MMMM dd, yyyy", Locale.ENGLISH);

DateTimeFormatter formatterFrench = DateTimeFormatter.ofPattern("MMMM dd, yyyy", Locale.FRENCH);

LocalDate localDate = LocalDate.parse(dateString, formatterEnglish);

return localDate.format(formatterFrench);

}

 

Call:

 

System.out.println(English2French("September 03, 2020"));