Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
TDIALLO
Contributor
Contributor

Conversion de date de type 27. Jul 22, 17. Aug 22 en 2022 en "yyyy/MM/dd" ==> 2022/07/27

Bonjour,

Je demande de l'aide sur une conversion de type de date qui est un peu nouveau pour moi.

J'ai le format suivant par exemple dans le fichier:

27. Jul 22,

25. May 22,

17. Aug 22,

et je le veux sous le format

"yyyy/MM/dd" ==>

2022/07/27 par exemple

Merci par avance de votre aide

In English

Hello,

I'm asking for help on a date type conversion which is a bit new to me.

I have the following format for example in the file:

27. Jul 22,

25. May 22,

17. Aug 22,

and I want it in the format "yyyy/MM/dd" ==> 2022/07/27 for example

Thank you in advance for your help

Labels (3)
6 Replies
gjeremy1617088143

hi @THIERNO DIALLO​ ,the pattern for this date is "dd.MMM yy" so if your input field data type is date you can set the pattern i mentioned just before and in the output you can change the pattern to "yyyy/MM/dd"

TDIALLO
Contributor
Contributor
Author

 

hi @gjeremy1617088143 

thank you for your feedback but it does not work. there is a space between the . and the month example: 27. Jul 22

I keep trying things but it still doesn't work

 

 

gjeremy1617088143

"dd. MMM yy"

TDIALLO
Contributor
Contributor
Author

I have already tried this format """dd. MMM yy" but it still fails to parse the date

 

 

Anonymous
Not applicable

Hi

What's the error you are getting?

I made a simple testing with this expression and it works.

String s1 = "25. May 22";

 

java.util.Date date1=TalendDate.parseDate("dd. MMM yy", s1);

 

System.out.println(date1);

 

Regards

Shong

TDIALLO
Contributor
Contributor
Author

hello Shong,

your method works. finally in the file there were several types of dates. So I left the input format as is and put the yyyy/MM/dd format in output and it worked;

thank you very much for your feedback