![JAR search and dependency download from the Maven repository](/logo.png)
org.ioc.commons.i18n.DateTimeFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons Show documentation
Show all versions of ioc-commons Show documentation
This project defines a set of useful java interfaces for helping you in the definition of the structure of your developments in Java-projects which are designed using a Inversion-Of-Control (IOC) pattern. Useful for MVP-Pattern designs in applications coded on GWT, SWT, Android, etc.
package org.ioc.commons.i18n;
import java.util.Date;
/**
* A common date time formatter for all the implementations
*
* @author Jesús Lunar Pérez
*
*/
public interface DateTimeFormatter {
public enum SystemDefaultFormat {
DateTime, Date, Time
}
public enum PredefinedFormat {
DAY, HOUR_MINUTE, HOUR_MINUTE_SECOND, HOUR24_MINUTE, HOUR24_MINUTE_SECOND, MINUTE_SECOND, MONTH, MONTH_DAY, MONTH_NUM_DAY, MONTH_WEEKDAY_DAY, YEAR, YEAR_MONTH, YEAR_MONTH_DAY, YEAR_MONTH_NUM, YEAR_MONTH_NUM_DAY, YEAR_MONTH_WEEKDAY_DAY,
}
/**
* Format a date into a string by using the default system/device format
* (according to user settings)
*
* @param format System default format to use
* @param date Date to format
* @return An string-formatted date
*/
String format(SystemDefaultFormat format, Date date);
String format(SystemDefaultFormat format, Date date, int timeZoneOffsetInMinutes);
Date parse(SystemDefaultFormat format, String stringDate);
String format(PredefinedFormat format, Date date);
String format(PredefinedFormat format, Date date, int timeZoneOffsetInMinutes);
Date parse(PredefinedFormat format, String stringDate);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy