Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
falco-
Contributor III
Contributor III

[resolved] Date dans fichier de sortie

Bonjour,
en Talend 5 je n'arrive pas à mettre une date au fichier de sortie !
J'ai essayé :
context.path + "out.xls" + "(TalendDate.getCurrentDate("yyyyMMdd HHmm"))"
J'ai aussi essayé de créer une variable context.date mais je ne sais pas comment la renseigner ?
Merci
Labels (2)
1 Solution

Accepted Solutions
falco-
Contributor III
Contributor III
Author

Hello,
I forgot to add the variable in the context!
Thanks
ok with :
create a tJava with
context.timeStamp TalendDate.formatDate = ("yyyyMMdd_HHmmssSSS" TalendDate.getCurrentDate ());
then I put:
context.path + "outZ305.xls" + context.timeStamp

View solution in original post

5 Replies
falco-
Contributor III
Contributor III
Author

RE,
j'ai essayé de créer un tjava avec
context.timeStamp = TalendDate.formatDate("yyyyMMdd_HHmmssSSS",TalendDate.getCurrentDate());
puis j'ai mis :
context.path + "outZ305.xls" + context.timeStamp
Erreurs ...
Merci
janhess
Creator II
Creator II

Hi This is an English language forum. Please translate.
falco-
Contributor III
Contributor III
Author

Hello,
in Talend 5Ican not put a date to the output file!
I tried:
context.path + "out.xls" + "(TalendDate.getCurrentDate (" YYYYMMDD HHmm "))"
I also tried to create a variable context.date but I do not know how to learn?
I tried to create a tJava with
context.timeStamp TalendDate.formatDate = ("yyyyMMdd_HHmmssSSS" TalendDate.getCurrentDate ());
then I put:
context.path + "outZ305.xls" + context.timeStamp
Errors ...
falco-
Contributor III
Contributor III
Author

Hello,
I forgot to add the variable in the context!
Thanks
ok with :
create a tJava with
context.timeStamp TalendDate.formatDate = ("yyyyMMdd_HHmmssSSS" TalendDate.getCurrentDate ());
then I put:
context.path + "outZ305.xls" + context.timeStamp
Anonymous
Not applicable

Bonjour,
La première ligne n'a pas de sens sauf si tu veux écrire la chaine "(TalendDate.getCurrentDate("yyyyMMdd HHmm"))";
Le deuxième essai fonctionne chez moi, sans contexte :
System.out.println(TalendDate.formatDate("yyyyMMdd_HHmmssSSS",TalendDate.getCurrentDate()));

affiche bien la date courante formattée comme demandée. Vérifie le type de ton contexte.timeStamp si tu tiens à la stocker dans le contexte, sinon fais simplement :
context.path +  "out.xls" + TalendDate.formatDate("yyyyMMdd_HHmmssSSS",TalendDate.getCurrentDate())

EDIT : Arf, tout ça pour ça 0683p000009MACJ.png