Package com.ibm.icu.util

Examples of com.ibm.icu.util.Calendar$CalendarFactory


  public IValue printDateInLocale(IDateTime inputDate, IString formatString, IString locale)
  //@doc{Print an input date using a specific locale and format string}
  {
    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


  public IValue printDateInLocale(IDateTime inputDate, IString locale)
  //@doc{Print an input date using a specific locale and a default format string}
  {
    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

  public IValue printTime(IDateTime inputTime, IString formatString)
  //@doc{Print an input time using the given format string}
  {
    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

 
  public IValue printTime(IDateTime inputTime)
  //@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()));
  }
View Full Code Here

  public IValue printTimeInLocale(IDateTime inputTime, IString formatString, IString locale)
  //@doc{Print an input time using a specific locale and format string}
  {
    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

  public IValue printTimeInLocale(IDateTime inputTime, IString locale)
  //@doc{Print an input time using a specific locale and a default format string}
  {
    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

  public IValue printDateTime(IDateTime inputDateTime, IString formatString)
  //@doc{Print an input datetime using the given format string}
  {
    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

  public IValue printDateTime(IDateTime inputDateTime)
  //@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()));
  }
View Full Code Here

  public IValue printDateTimeInLocale(IDateTime inputDateTime, IString formatString, IString locale)
  //@doc{Print an input datetime using a specific locale and format string}
  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat(formatString.getValue(),new ULocale(locale.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() +
          " in locale: " + locale.getValue(), null, null);
    }
  }
View Full Code Here

  public IValue printDateTimeInLocale(IDateTime inputDateTime, IString locale)
  //@doc{Print an input datetime using a specific locale and a default format string}
  {
    try {
      SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ",new ULocale(locale.getValue()));
      Calendar cal = getCalendarForDateTime(inputDateTime);
      sd.setCalendar(cal);
      return values.string(sd.format(cal.getTime()));
    } catch (IllegalArgumentException iae) {
      throw RuntimeExceptionFactory.dateTimePrintingError("Cannot print datetime in locale: " + locale.getValue(), null, null);
    }
  }
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.Calendar$CalendarFactory

Copyright © 2018 www.massapicom. 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.