Bonjour à tous!
Comment utiliser JSL ou une formule pour convertir le texte de la colonne 1 dans le format d'heure de la colonne 2.
Merci!

Voici un format qui fonctionnera avec les exemples que vous avez fournis.Il devra être modifié pour d'autres combinaisons de valeurs et de structure.Ci-joint un exemple de tableau de données avec la formule appliquée
If( Row() == 1,
moList = {"January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"};
moAbvList = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
"Oct", "Nov", "Dec"};
);
If(
Word( 3, :Mdfc, " /-" ) == "",
theDay = Num( Substr( :Mdfc, 1, 2 ) );
theMonth = Contains( moAbvList, Substr( :Mdfc, 4, 3 ) );
theYear = Num( Word( -1, :Mdfc, "abcdefghijklmnopqrstuvwxyz" ) );
Show( theday, themonth, theyear, Substr( :Mdfc, 4, 3 ) );,
Is Missing( Num( Word( 2, :Mdfc, " /-" ) ) ) == 1,
theDay = Num( Word( 1, :Mdfc, " /-" ) );
theMonth = Contains( moList, Word( 2, :Mdfc, " /-" ) );
theYear = Num( Word( 3, :Mdfc, " /-" ) );,
Is Missing( Num( Word( 1, :Mdfc, " /-" ) ) ) == 1,
theDay = Num( Word( 2, :Mdfc, " /-" ) );
theMonth = Contains( moList, Word( 1, :Mdfc, " /-" ) );
theYear = Num( Word( 3, :Mdfc, " /-" ) );,
theDay = Num( Word( 2, :Mdfc, " /-" ) );
theMonth = Num( Word( 1, :Mdfc, " /-" ) );
theYear = Num( Word( 3, :Mdfc, " /-" ) );
);
Date MDY( theMonth, theDay, theYear );C'est le style, merci !
L'effet est le même :
format(x, "a/m/j") ———— format(x, "aaaaammjj")
La Format() fonction est utilisée pour convertir un Date, heure ou date/heure JMP à une chaîne de texte.
Par exemple:
x=informat("20000214");
show(format(x, "m/d/y"));
show(format(x, "d/m/y"));
show(format(x, "Date Long"));
show(format(x, "Monddyyyy"));
Résultats dans ceci dans le journal :
Format(x, "m/d/y") = "02/14/2000";
Format(x, "d/m/y") = "14/02/2000";
Format(x, "Date Long") = "Monday, February 14, 2000";
Format(x, "Monddyyyy") = "Feb142000";
Comment JMP peut-il obtenir le texte de l'année, du mois et du jour à partir du format de date ?
Désolé de vous déranger encore, merci !

@txnelson La formule de fonctionnera, mais il existe une formule légèrement plus simple qui fonctionnera également.

Celui-ci utilise Informer() pour convertir les valeurs de date et d'heure.
Informat( Word( 1, :Column 1 ) ) +Informat( Word( 2, :Column 1 ), "h:m" )
Voici la formule de conversion
Date DMY(
Num( Substr( :date, 7, 2 ) ),
Num( Substr( :date, 5, 2 ) ),
Num( Substr( :date, 1, 4 ) ) ) +
60 * 60 * Num( Word( 2, :date, " :" ) ) +
60 * Num( Word( -1, :date, " :" ) )