Package com.ibm.icu.text

Examples of com.ibm.icu.text.SimpleDateFormat.format()


  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat(formatString.getValue());
      Calendar cal = getCalendarForDate(inputDate);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print time with format " + formatString.getValue(), null, null);
    }
  }
View Full Code Here


  //@doc{Print an input date using a default format string}
  {
    SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
    Calendar cal = getCalendarForDate(inputDate);
    sd.setCalendar(cal);
    return values.string(sd.format(cal.getTime()));
  }
 
  public IValue printDateInLocale(IDateTime inputDate, IString formatString, IString locale)
  //@doc{Print an input date using a specific locale and format string}
  {
View Full Code Here

  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat(formatString.getValue(),new ULocale(locale.getValue()));
      Calendar cal = getCalendarForDate(inputDate);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print time with format " + formatString.getValue() + ", in locale: " + locale.getValue(), null, null);
    }
  }
View Full Code Here

  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd",new ULocale(locale.getValue()));
      Calendar cal = getCalendarForDate(inputDate);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print time in locale: " + locale.getValue(), null, null);
    }
  }
View Full Code Here

  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat(formatString.getValue());
      Calendar cal = getCalendarForTime(inputTime);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print time with format: " + formatString.getValue(), null, null);
    }     
  }
 
View Full Code Here

  //@doc{Print an input time using a default format string}
  {
    SimpleDateFormat sd = new SimpleDateFormat("HH:mm:ss.SSSZ");
    Calendar cal = getCalendarForTime(inputTime);
    sd.setCalendar(cal);
    return values.string(sd.format(cal.getTime()));
  }
 
  public IValue printTimeInLocale(IDateTime inputTime, IString formatString, IString locale)
  //@doc{Print an input time using a specific locale and format string}
  {
View Full Code Here

  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat(formatString.getValue(),new ULocale(locale.getValue()));
      Calendar cal = getCalendarForTime(inputTime);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print time in locale: " + locale.getValue(), null, null);
    }
  }
View Full Code Here

  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat("HH:mm:ss.SSSZ",new ULocale(locale.getValue()));
      Calendar cal = getCalendarForTime(inputTime);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print time in locale: " + locale.getValue(), null, null);
    }
  }
View Full Code Here

  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat(formatString.getValue());
      Calendar cal = getCalendarForDateTime(inputDateTime);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print datetime using format string: " + formatString.getValue(), null, null);
    }   
  }
View Full Code Here

  //@doc{Print an input datetime using a default format string}
  {
    SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
    Calendar cal = getCalendarForDateTime(inputDateTime);
    sd.setCalendar(cal);
    return values.string(sd.format(cal.getTime()));
  }
 
  public IValue printDateTimeInLocale(IDateTime inputDateTime, IString formatString, IString locale)
  //@doc{Print an input datetime using a specific locale and format string}
  {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.