Add short date functionality.
This commit is contained in:
parent
5e939ed560
commit
cf78d377f0
1 changed files with 22 additions and 0 deletions
22
src/fr/devinsy/util/DateHelper.java
Executable file → Normal file
22
src/fr/devinsy/util/DateHelper.java
Executable file → Normal 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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue