Add short date functionality.

This commit is contained in:
Christian P. MOMON 2010-10-22 18:31:59 +02:00
parent 5e939ed560
commit cf78d377f0

22
src/fr/devinsy/util/DateHelper.java Executable file → Normal file
View file

@ -21,6 +21,7 @@ public class DateHelper
//static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger (DateHelper.class);
static final String EUROPEAN_DATE_FORMAT = "%02d/%02d/%04d";
static final String SHORT_EUROPEAN_DATE_FORMAT = "%02d/%02d";
static final String RAW_DATE_FORMAT = "%04d%02d%02d";
static final String ISO_DATE_FORMAT = "%04d-%02d-%02d";
static final String AMERICAN_DATE_FORMAT = "%02d/%02d/%04d";
@ -52,6 +53,27 @@ public class DateHelper
}
/**
*
*/
static public String shortEuropeanFormat (Calendar time)
{
String result;
if (time == null)
{
result = "";
}
else
{
result = String.format (SHORT_EUROPEAN_DATE_FORMAT, time.get(Calendar.DAY_OF_MONTH), time.get(Calendar.MONTH) + 1);
}
//
return (result);
}
/**
*
*/