598 sec = 0; 599 if (min < 0) 600 min = 0; 601 if (hour < 0) 602 hour = 0; 603 BaseCalendar cal = getCalendarSystem(year); 604 if (tzoffset == -1) { // no time zone specified, have to use local 605 BaseCalendar.Date ldate = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.getDefaultRef()); 606 ldate.setDate(year, mon + 1, mday); 607 ldate.setTimeOfDay(hour, min, sec, 0); 608 return cal.getTime(ldate); 609 } 610 BaseCalendar.Date udate = (BaseCalendar.Date) cal.newCalendarDate(null); // no time zone 611 udate.setDate(year, mon + 1, mday); 612 udate.setTimeOfDay(hour, min, sec, 0); 613 return cal.getTime(udate) + tzoffset * (60 * 1000); 614 } 615 // syntax error 616 throw new IllegalArgumentException(); 617 } 618 private static final String wtb[] = { 619 "am", "pm", 620 "monday", "tuesday", "wednesday", "thursday", "friday", 621 "saturday", "sunday", 622 "january", "february", "march", "april", "may", "june", 623 "july", "august", "september", "october", "november", "december", 624 "gmt", "ut", "utc", "est", "edt", "cst", "cdt", 625 "mst", "mdt", "pst", "pdt" 626 }; 627 private static final int ttb[] = { 628 14, 1, 0, 0, 0, 0, 0, 0, 0, 629 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 630 10000 + 0, 10000 + 0, 10000 + 0, // GMT/UT/UTC 631 10000 + 5 * 60, 10000 + 4 * 60, // EST/EDT 632 10000 + 6 * 60, 10000 + 5 * 60, // CST/CDT 633 10000 + 7 * 60, 10000 + 6 * 60, // MST/MDT 634 10000 + 8 * 60, 10000 + 7 * 60 // PST/PDT 635 }; 636 637 /** 638 * Returns a value that is the result of subtracting 1900 from the 639 * year that contains or begins with the instant in time represented 640 * by this {@code Date} object, as interpreted in the local 641 * time zone. 642 * 643 * @return the year represented by this date, minus 1900. 644 * @see java.util.Calendar 645 * @deprecated As of JDK version 1.1, 646 * replaced by {@code Calendar.get(Calendar.YEAR) - 1900}. 647 */ | 598 sec = 0; 599 if (min < 0) 600 min = 0; 601 if (hour < 0) 602 hour = 0; 603 BaseCalendar cal = getCalendarSystem(year); 604 if (tzoffset == -1) { // no time zone specified, have to use local 605 BaseCalendar.Date ldate = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.getDefaultRef()); 606 ldate.setDate(year, mon + 1, mday); 607 ldate.setTimeOfDay(hour, min, sec, 0); 608 return cal.getTime(ldate); 609 } 610 BaseCalendar.Date udate = (BaseCalendar.Date) cal.newCalendarDate(null); // no time zone 611 udate.setDate(year, mon + 1, mday); 612 udate.setTimeOfDay(hour, min, sec, 0); 613 return cal.getTime(udate) + tzoffset * (60 * 1000); 614 } 615 // syntax error 616 throw new IllegalArgumentException(); 617 } 618 private static final String[] wtb = { 619 "am", "pm", 620 "monday", "tuesday", "wednesday", "thursday", "friday", 621 "saturday", "sunday", 622 "january", "february", "march", "april", "may", "june", 623 "july", "august", "september", "october", "november", "december", 624 "gmt", "ut", "utc", "est", "edt", "cst", "cdt", 625 "mst", "mdt", "pst", "pdt" 626 }; 627 private static final int[] ttb = { 628 14, 1, 0, 0, 0, 0, 0, 0, 0, 629 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 630 10000 + 0, 10000 + 0, 10000 + 0, // GMT/UT/UTC 631 10000 + 5 * 60, 10000 + 4 * 60, // EST/EDT 632 10000 + 6 * 60, 10000 + 5 * 60, // CST/CDT 633 10000 + 7 * 60, 10000 + 6 * 60, // MST/MDT 634 10000 + 8 * 60, 10000 + 7 * 60 // PST/PDT 635 }; 636 637 /** 638 * Returns a value that is the result of subtracting 1900 from the 639 * year that contains or begins with the instant in time represented 640 * by this {@code Date} object, as interpreted in the local 641 * time zone. 642 * 643 * @return the year represented by this date, minus 1900. 644 * @see java.util.Calendar 645 * @deprecated As of JDK version 1.1, 646 * replaced by {@code Calendar.get(Calendar.YEAR) - 1900}. 647 */ |