Code example for GregorianCalendar

Methods: set

0
  } 
 
  public static Date createDateTime(final int year, final int month, final int day, final int hour,
                                    final int minute, final int second, final LocalizationContext context)
  { 
    final GregorianCalendar gc = new GregorianCalendar(context.getTimeZone(),
        context.getLocale());
    gc.set(Calendar.DAY_OF_MONTH, day);
    gc.set(Calendar.MONTH, month);
    gc.set(Calendar.YEAR, year);
    gc.set(Calendar.MILLISECOND, 0);
    gc.set(Calendar.HOUR_OF_DAY, hour);
    gc.set(Calendar.MINUTE, minute);
    gc.set(Calendar.SECOND, second);
    return gc.getTime();
  } 
 
  public static Time createTime(final int hour, final int minute, final int second,
                                final LocalizationContext context)
  { 
    final GregorianCalendar gc = new GregorianCalendar(context.getTimeZone(),