Code example for Time

Methods: normalize, set

0
        public Time date;
        public Time allDayDate;
        public int expectedWeekNumber;
 
        public DateAndWeekNumber(int year, int month, int day, int expectedWeekNumber) {
            date = new Time();
            allDayDate = new Time(Time.TIMEZONE_UTC);
 
            date.set(0, 0, 0, day, month, year);
            date.normalize(true /* ignore isDst */);
 
            allDayDate.set(day, month, year);
            allDayDate.normalize(true /* ignore isDst */);
 
            this.expectedWeekNumber = expectedWeekNumber; 
        } 
    } 
 
    DateAndWeekNumber[] tests = {
            new DateAndWeekNumber(1998, 11, 28, 53), 
            new DateAndWeekNumber(1998, 11, 29, 53),