Code example for GregorianCalendar

Methods: set

0
  } 
 
  public static java.sql.Date createDate(final int year, final int month, final int day,
                                         final LocalizationContext context)
  { 
    final GregorianCalendar gc = new GregorianCalendar(context.getTimeZone(),
        context.getLocale());
    gc.set(Calendar.DAY_OF_MONTH, day);
    gc.set(Calendar.MONTH, month - 1);
    gc.set(Calendar.YEAR, year);
    gc.set(Calendar.MILLISECOND, 0);
    gc.set(Calendar.HOUR_OF_DAY, 0);
    gc.set(Calendar.MINUTE, 0);
    gc.set(Calendar.SECOND, 0);
    return new java.sql.Date(gc.getTime().getTime());
  } 
 
  public static Calendar createCalendar(final Date date, final LocalizationContext context)
  { 
    final GregorianCalendar gc = new GregorianCalendar(context.getTimeZone(),
        context.getLocale());