Date
Commande de compilation
javac -g -classpath ${UPS_HOME}/upsjav/upsjav/french/upsvtm.jar binaire.java
Commande d'exécution
java -classpath ${UPS_HOME}/upsjav/upsjav/french/upsvtm.jar;. -Djava.library.path=${UPS_HOME}/upsvtm/bin;${UPS_HOME}/upsnet/bin;${UPS_HOME}/upscmp/bin;${UPS_HOME}/upscom/bin;${UPS_HOME}/upscrb/bin;${UPS_HOME}/upsjav/bin;${UPS_HOME}/upsjav/bin/french date
Fichier source
import UpsKrn.Binaire;
import UpsKrn.Caractere;
import UpsKrn.Entier;
import UpsKrn.MUpsKrn;
import UpsKrn.UpsException;
public class date
/******************/
{
public static void main(String s[])
/*********************************/
{
Date D;
float R;
try
{
if (!MUpsKrn.Demarrer())
D=Date.Date2(MUpsKrn.JavaString2Caractere("27-01-1998"));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date2(MUpsKrn.JavaString2Caractere("27-01-1998 21:00:14"));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date2(MUpsKrn.JavaString2Caractere("27-01-1998 21:00:14:98"));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date3(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date5(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14),MUpsKrn.JavaInt2Entier(98));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).Additionner(MUpsKrn.JavaInt2Entier(70));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14));
D.AdditionnerAffecter(MUpsKrn.JavaInt2Entier(70));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).Soustraire(MUpsKrn.JavaInt2Entier(20));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(">);
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14));
D.SoustraireAffecter(MUpsKrn.JavaInt2Entier(20));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterMinutes(MUpsKrn.JavaInt2Entier(62));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterMinutes(MUpsKrn.JavaInt2Entier(-11));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterHeures(MUpsKrn.JavaInt2Entier(4));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterHeures(MUpsKrn.JavaInt2Entier(-11));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterJours(MUpsKrn.JavaInt2Entier(4));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterJours(MUpsKrn.JavaInt2Entier(-30));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterMois(MUpsKrn.JavaInt2Entier(4));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterMois(MUpsKrn.JavaInt2Entier(-3));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterAnnees(MUpsKrn.JavaInt2Entier(4));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterAnnees(MUpsKrn.JavaInt2Entier(-3));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterMilliemes(MUpsKrn.JavaInt2Entier(980));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterMilliemes(MUpsKrn.JavaInt2Entier(-980));
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).DernierJour();
System.out.println(D.Jour());
System.out.println(D.Mois());
System.out.println(D.Annee());
System.out.println(D.Heure());
System.out.println(D.Minute());
System.out.println(D.Seconde());
System.out.println(D.Millieme());
System.out.println(");
R=MUpsKrn.Reel2JavaFloat(Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).Soustraire2(
Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(20),MUpsKrn.JavaInt2Entier(8),MUpsKrn.JavaInt2Entier(6))));
System.out.println(R);
D=Date.Date4(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),MUpsKrn.JavaInt2Entier(1998),
MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),MUpsKrn.JavaInt2Entier(14)).AjouterMilliemes(MUpsKrn.JavaInt2Entier(980));
if (MUpsKrn.Booleen2JavaBoolean(D.Egal(Date.Date5(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),
MUpsKrn.JavaInt2Entier(1998),MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),
MUpsKrn.JavaInt2Entier(14),MUpsKrn.JavaInt2Entier(980)))))
System.out.println("D==29-1-1998 21:9:14:980");
if (MUpsKrn.Booleen2JavaBoolean(D.Different(Date.Date5(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),
MUpsKrn.JavaInt2Entier(1998),MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),
MUpsKrn.JavaInt2Entier(14),MUpsKrn.JavaInt2Entier(980)))))
System.out.println("D!=29-1-1998 21:9:14:980");
if (MUpsKrn.Booleen2JavaBoolean(D.InferieurOuEgal(Date.Date5(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),
MUpsKrn.JavaInt2Entier(1998),MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),
MUpsKrn.JavaInt2Entier(14),MUpsKrn.JavaInt2Entier(980)))))
System.out.println("D<=29-1-1998 21:9:14:980");
if (MUpsKrn.Booleen2JavaBoolean(D.SuperieurOuEgal(Date.Date5(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),
MUpsKrn.JavaInt2Entier(1998),MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),
MUpsKrn.JavaInt2Entier(14),MUpsKrn.JavaInt2Entier(980)))))
System.out.println("D>=29-1-1998 21:9:14:980");
if (MUpsKrn.Booleen2JavaBoolean(D.Inferieur(Date.Date5(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),
MUpsKrn.JavaInt2Entier(1998),MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),
MUpsKrn.JavaInt2Entier(14),MUpsKrn.JavaInt2Entier(980)))))
System.out.println("D<29-1-1998 21:9:14:980");
if (MUpsKrn.Booleen2JavaBoolean(D.Superieur(Date.Date5(MUpsKrn.JavaInt2Entier(27),MUpsKrn.JavaInt2Entier(1),
MUpsKrn.JavaInt2Entier(1998),MUpsKrn.JavaInt2Entier(21),MUpsKrn.JavaInt2Entier(9),
MUpsKrn.JavaInt2Entier(14),MUpsKrn.JavaInt2Entier(980)))))
System.out.println("D>29-1-1998 21:9:14:980");
D=Date.Date2(MUpsKrn.JavaString2Caractere("29-1-1998 21:9:14"));
System.out.println(MUpsKrn.Caractere2JavaString(Caractere.Caractere4(D,MUpsKrn.JavaString2Caractere("%jj-%mm-%A %HH:%Mi:%S"))));
System.out.println(MUpsKrn.Caractere2JavaString(Caractere.Caractere4(D,MUpsKrn.JavaString2Caractere("%J %JJ %M %MM"))));
MUpsKrn.Arreter();
}
catch (java.lang.Throwable e)
{
try
{
System.out.println("Erreur UpsKrn-0 : L'exception suivante a été envoyée dans le source '"
+e.NomSourceEnErreur+"' ligne "+e.NumeroLigne+", colonne "+e.NumeroColonne+" :");
System.out.println(e.MessageErreur);
}
catch (java.lang.Throwable e2)
{
System.out.println(e2.toString());
}
}
}
}