congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DateFormat.getDateInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
getDateInstance
method
in
com.ibm.icu.text.DateFormat

Best Java code snippets using com.ibm.icu.text.DateFormat.getDateInstance (Showing top 20 results out of 315)

origin: marytts/marytts

public Preprocess() {
  super("Preprocess", MaryDataType.TOKENS, MaryDataType.WORDS, Locale.ENGLISH);
  this.rbnf = new RuleBasedNumberFormat(ULocale.ENGLISH, RuleBasedNumberFormat.SPELLOUT);
  this.cardinalRule = "%spellout-numbering";
  this.ordinalRule = getOrdinalRuleName(rbnf);
  this.yearRule = getYearRuleName(rbnf);
  this.df = DateFormat.getDateInstance(DateFormat.LONG, ULocale.ENGLISH);
  try {
    this.abbrevMap = loadAbbrevMap();
  } catch (IOException e) {
    e.printStackTrace();
  }
}
origin: mfornos/humanize

  @Override
  public DateFormat call() throws Exception
  {
    return DateFormat.getDateInstance(style, locale);
  }
});
origin: at.bestsolution.eclipse/com.ibm.icu.base

/**
 * Convenience overload.
 * @stable ICU 2.0
 */
static final public DateFormat getDateInstance(Calendar cal, int dateStyle) {
  return getDateInstance(cal, dateStyle, ULocale.getDefault(Category.FORMAT));
}
origin: org.eclipse.platform/org.eclipse.text

  @Override
  protected String resolve(TemplateContext context) {
    return DateFormat.getDateInstance().format(new java.util.Date());
  }
}
origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

/**
 * Convenience overload.
 * @stable ICU 2.0
 */
static final public DateFormat getDateInstance(Calendar cal, int dateStyle) {
  return getDateInstance(cal, dateStyle, ULocale.getDefault(Category.FORMAT));
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.text

  @Override
  protected String resolve(TemplateContext context) {
    return DateFormat.getDateInstance().format(new java.util.Date());
  }
}
origin: io.virtdata/virtdata-lib-realer

/**
 * Creates a {@link DateFormat} object for the default locale that can be used
 * to format dates in the calendar system specified by <code>cal</code>.
 * <p>
 * @param cal   The calendar system for which a date format is desired.
 *
 * @param dateStyle The type of date format desired.  This can be
 *              {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM},
 *              etc.
 * @stable ICU 2.0
 */
static final public DateFormat getDateInstance(Calendar cal, int dateStyle) {
  return getDateInstance(cal, dateStyle, ULocale.getDefault(Category.FORMAT));
}
origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

/**
 * Creates a {@link DateFormat} object that can be used to format dates in
 * the calendar system specified by <code>cal</code>.
 * <p>
 * @param cal   The calendar system for which a date format is desired.
 *
 * @param dateStyle The type of date format desired.  This can be
 *              {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM},
 *              etc.
 *
 * @param locale The locale for which the date format is desired.
 * @stable ICU 3.2
 */
static final public DateFormat getDateInstance(Calendar cal, int dateStyle, ULocale locale)
{
  DateFormat df = getDateInstance(dateStyle, locale);
  df.setCalendar(cal);
  return df;
}
origin: at.bestsolution.eclipse/com.ibm.icu.base

/**
 * Creates a {@link DateFormat} object that can be used to format dates in
 * the calendar system specified by <code>cal</code>.
 * <p>
 * @param cal   The calendar system for which a date format is desired.
 *
 * @param dateStyle The type of date format desired.  This can be
 *              {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM},
 *              etc.
 *
 * @param locale The locale for which the date format is desired.
 * @stable ICU 3.2
 */
static final public DateFormat getDateInstance(Calendar cal, int dateStyle, ULocale locale)
{
  DateFormat df = getDateInstance(dateStyle, locale);
  df.setCalendar(cal);
  return df;
}
origin: at.bestsolution.eclipse/com.ibm.icu.base

/**
 * Creates a {@link DateFormat} object that can be used to format dates in
 * the calendar system specified by <code>cal</code>.
 * <p>
 * @param cal   The calendar system for which a date format is desired.
 *
 * @param dateStyle The type of date format desired.  This can be
 *              {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM},
 *              etc.
 *
 * @param locale The locale for which the date format is desired.
 * @stable ICU 2.0
 */
static final public DateFormat getDateInstance(Calendar cal, int dateStyle, Locale locale)
{
  DateFormat df = getDateInstance(dateStyle, locale);
  df.setCalendar(cal);
  return df;
}
origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

/**
 * Creates a {@link DateFormat} object that can be used to format dates in
 * the calendar system specified by <code>cal</code>.
 * <p>
 * @param cal   The calendar system for which a date format is desired.
 *
 * @param dateStyle The type of date format desired.  This can be
 *              {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM},
 *              etc.
 *
 * @param locale The locale for which the date format is desired.
 * @stable ICU 2.0
 */
static final public DateFormat getDateInstance(Calendar cal, int dateStyle, Locale locale)
{
  DateFormat df = getDateInstance(dateStyle, locale);
  df.setCalendar(cal);
  return df;
}
origin: org.apache.cocoon/cocoon-forms-impl

protected SimpleDateFormat getDateFormat(Locale locale) {
  SimpleDateFormat dateFormat = null;
  if (this.variant.equals(DATE)) {
    //dateFormat = I18nSupport.getInstance().getDateFormat(style, locale);
    dateFormat = (SimpleDateFormat)DateFormat.getDateInstance(style, locale);
  } else if (this.variant.equals(TIME)) {
    //dateFormat = I18nSupport.getInstance().getTimeFormat(style, locale);
    dateFormat = (SimpleDateFormat)DateFormat.getTimeInstance(style, locale);
  } else if (this.variant.equals(DATE_TIME)) {
    //dateFormat = I18nSupport.getInstance().getDateTimeFormat(style, style, locale);
    dateFormat = (SimpleDateFormat)DateFormat.getDateTimeInstance(style, style, locale);
  }
  String pattern = (String)localizedPatterns.get(locale);
  if (pattern != null)
    // Note: this was previously using applyLocalizedPattern() which allows to use
    // a locale-specific pattern syntax, e.g. in french "j" (jour) for "d" and
    // "a" (annee) for "y". But the localized pattern syntax is very little known and thus
    // led to some weird pattern syntax error messages.
    dateFormat.applyPattern(pattern);
  else if (nonLocalizedPattern != null)
    dateFormat.applyPattern(nonLocalizedPattern);
  dateFormat.setLenient(lenient);
  return dateFormat;
}
origin: com.ibm.icu/icu4j-localespi

  private DateFormat getInstance(int dstyle, int tstyle, Locale locale) {
    com.ibm.icu.text.DateFormat icuDfmt;
    ULocale actual = ICULocaleServiceProvider.toULocaleNoSpecialVariant(locale);
    if (dstyle == NONE) {
      icuDfmt = com.ibm.icu.text.DateFormat.getTimeInstance(tstyle, actual);
    } else if (tstyle == NONE) {
      icuDfmt = com.ibm.icu.text.DateFormat.getDateInstance(dstyle, actual);
    } else {
      icuDfmt = com.ibm.icu.text.DateFormat.getDateTimeInstance(dstyle, tstyle, actual);
    }
    if (!(icuDfmt instanceof com.ibm.icu.text.SimpleDateFormat)) {
      // icuDfmt must be always SimpleDateFormat
      return null;
    }

    return SimpleDateFormatICU.wrap((com.ibm.icu.text.SimpleDateFormat)icuDfmt);
  }
}
origin: at.bestsolution.eclipse/com.ibm.icu.base

/**
 * {@icu} Returns a <code>DateFormat</code> appropriate to this calendar.
 * Subclasses wishing to specialize this behavior should override
 * {@link #handleGetDateFormat}.
 * @stable ICU 2.0
 */
public DateFormat getDateTimeFormat(int dateStyle, int timeStyle, Locale loc) {
  if (dateStyle != DateFormat.NONE) {
    if (timeStyle == DateFormat.NONE) {
      return DateFormat.getDateInstance((Calendar)this.clone(), dateStyle, loc);
    } else {
      return DateFormat.getDateTimeInstance((Calendar)this.clone(), dateStyle, timeStyle, loc);
    }
  } else if (timeStyle != DateFormat.NONE) {
    return DateFormat.getTimeInstance((Calendar)this.clone(), timeStyle, loc);
  } else {
    return null;
  }
}
origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

/**
 * {@icu} Returns a <code>DateFormat</code> appropriate to this calendar.
 * Subclasses wishing to specialize this behavior should override
 * {@link #handleGetDateFormat}.
 * @stable ICU 2.0
 */
public DateFormat getDateTimeFormat(int dateStyle, int timeStyle, Locale loc) {
  if (dateStyle != DateFormat.NONE) {
    if (timeStyle == DateFormat.NONE) {
      return DateFormat.getDateInstance((Calendar)this.clone(), dateStyle, loc);
    } else {
      return DateFormat.getDateTimeInstance((Calendar)this.clone(), dateStyle, timeStyle, loc);
    }
  } else if (timeStyle != DateFormat.NONE) {
    return DateFormat.getTimeInstance((Calendar)this.clone(), timeStyle, loc);
  } else {
    return null;
  }
}
origin: io.virtdata/virtdata-lib-realer

private void addICUPatterns(PatternInfo returnInfo, ULocale uLocale) {
  // first load with the ICU patterns
  for (int i = DateFormat.FULL; i <= DateFormat.SHORT; ++i) {
    SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(i, uLocale);
    addPattern(df.toPattern(), false, returnInfo);
    df = (SimpleDateFormat) DateFormat.getTimeInstance(i, uLocale);
    addPattern(df.toPattern(), false, returnInfo);
    if (i == DateFormat.SHORT) {
      consumeShortTimePattern(df.toPattern(), returnInfo);
    }
  }
}
origin: io.virtdata/virtdata-lib-realer

DateFormat df = DateFormat.getDateInstance(newStyle, locale);
if (df instanceof SimpleDateFormat) {
  fDateTimeFormat = (SimpleDateFormat)df;
origin: io.virtdata/virtdata-lib-realer

/**
 * This function can be overridden by subclasses to use different heuristics.
 * <b>It MUST return a 'safe' value,
 * one whose modification will not affect this object.</b>
 *
 * @param dateStyle
 * @param timeStyle
 * @draft ICU 3.6
 * @provisional This API might change or be removed in a future release.
 */
protected DateFormat guessDateFormat(int dateStyle, int timeStyle) {
  DateFormat result;
  ULocale dfLocale = getAvailableLocale(TYPE_DATEFORMAT);
  if (dfLocale == null) {
    dfLocale = ULocale.ROOT;
  }
  if (timeStyle == DF_NONE) {
    result = DateFormat.getDateInstance(getCalendar(), dateStyle, dfLocale);
  } else if (dateStyle == DF_NONE) {
    result = DateFormat.getTimeInstance(getCalendar(), timeStyle, dfLocale);
  } else {
    result = DateFormat.getDateTimeInstance(getCalendar(), dateStyle, timeStyle, dfLocale);
  }
  return result;
}
origin: org.eclipse.platform/org.eclipse.compare

lastDay= new TreeItem(fEditionTree, SWT.NONE);
lastDay.setImage(fDateImage);
String df= DateFormat.getDateInstance().format(date);
long today= dayNumber(System.currentTimeMillis());
origin: org.eclipse/org.eclipse.compare

lastDay= new TreeItem(fEditionTree, SWT.NONE);
lastDay.setImage(fDateImage);
String df= DateFormat.getDateInstance().format(date);
long today= dayNumber(System.currentTimeMillis());
com.ibm.icu.textDateFormatgetDateInstance

Javadoc

Returns the date formatter with the default formatting style for the default FORMAT locale.

Popular methods of DateFormat

  • format
    Formats a Date into a date/time string.
  • getDateTimeInstance
    Creates a DateFormat object that can be used to format dates and times in the calendar system specif
  • parse
    Parses a date/time string according to the given parse position. For example, a time text "07/10/96
  • getTimeInstance
    Creates a DateFormat object that can be used to format times in the calendar system specified by cal
  • getInstance
    Returns a date/time formatter that uses the SHORT style for both the date and the time.
  • getPatternInstance
    Returns a DateFormat object that can be used to format dates and times in the given locale. The get
  • setTimeZone
    Sets the time zone for the calendar of this DateFormat object.
  • equals
    Overrides equals.
  • setCalendar
    Sets the calendar to be used by this date format. Initially, the default calendar for the specified
  • setNumberFormat
    Sets the number formatter.
  • <init>
  • getInstanceForSkeleton
    Returns a DateFormat object that can be used to format dates and times in the given locale.
  • <init>,
  • getInstanceForSkeleton,
  • getJDKFormatStyle,
  • hashCode,
  • setLenient,
  • toJDKFieldPosition,
  • clone,
  • formatToCharacterIterator,
  • get

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now