MDateAndTime { protected static long adjustTwoDigitYear(long year) { if(year <= 69) { year = year + 2000; } else if(year < 100) { year = 1900 + year; } return year; }  static String getMonthName(int numericRep, String locale, TExecutionContext context); static long[] fromJodaDateTime(AbstractDateTime date); static MutableDateTime toJodaDateTime(long[] dt, String tz); static MutableDateTime toJodaDateTime(long[] dt, DateTimeZone dtz); static String dateToString(int encodedDate); static int parseAndEncodeDate(String input); static int encodeDate(long millis, String tz); static int encodeDate(long[] dt); static int encodeDate(long y, long m, long d); static long[] decodeDate(long encodedDate); static long[] parseDate(long val); static long[] parseDateTime(long val); static String dateTimeToString(long encodedDateTime); static String dateTimeToString(long[] dt); static StringType parseDateOrTime(String st, long[] dt); static long parseAndEncodeDateTime(String input); static long encodeDateTime(long millis, String tz); static long encodeDateTime(BaseDateTime dt); static long encodeDateTime(long[] dt); static long encodeDateTime(long year, long month, long day, long hour, long min, long sec); static long[] decodeDateTime(long encodedDateTime); static String timeToString(int encodedTime); static String timeToString(long[] dt); static String timeToString(long h, long m, long s); static void timeToDatetime(long[] dt); static int parseTime(String string, TExecutionContext context); static long[] decodeTime(long encodedTime); static int encodeTime(long millis, String tz); static int encodeTime(long[] dt, TExecutionContext context); static int encodeTime(long h, long m, long s, TExecutionContext context); static int parseAndEncodeTimestamp(String input, String tz, TExecutionContext context); static long[] decodeTimestamp(long encodedTimestamp, String tz); static int encodeTimestamp(long[] dt, String tz, TExecutionContext context); static int encodeTimestamp(BaseDateTime dateTime, TExecutionContext context); static int encodeTimestamp(long millis, TExecutionContext context); static boolean isValidTimestamp(BaseDateTime dt); static int getTimestamp(long[] dt, String tz); static String timestampToString(long encodedTimestamp, String tz); static DateTimeZone parseTimeZone(String tz); static boolean isValidDateTime_Zeros(long[] dt); static boolean isValidDateTime(long[] dt, ZeroFlag... flags); static boolean isHrMinSecNegative(long[] dt); static boolean isHrMinSecNegative(long h, long m, long s); static boolean isValidHrMinSec(long[] dt, boolean checkHour, boolean isFromDateTime); static boolean isValidHrMinSec(long h, long m, long s, boolean checkHour, boolean isFromDateTime); static boolean isZeroDayMonth(long[] dt); static boolean isValidDate_Zeros(long[] dt); static boolean isValidDate_NoZeros(long[] dt); static boolean isValidDate(long[] dt, ZeroFlag... flags); static boolean isValidDate(long y, long m, long d, ZeroFlag... flags); static long getLastDay(long[] dt); static long getLastDay(long year, long month); static boolean isValidType(StringType type); static final NoAttrTClass DATE; static final NoAttrTClass DATETIME; static final NoAttrTClass TIME; static final NoAttrTClass YEAR; static final NoAttrTClass TIMESTAMP; static final Map<String, String[]> MONTHS; static final int YEAR_INDEX; static final int MONTH_INDEX; static final int DAY_INDEX; static final int HOUR_INDEX; static final int MIN_INDEX; static final int SEC_INDEX; static final int MAX_INDEX; static final long TIMESTAMP_MIN; static final long TIMESTAMP_MAX; static final long TS_ERROR_VALUE; static final int TIME_MAX; static final int TIME_MIN; }
@Test public void testAdjustTwoDigitYear() { assertEquals(2000, adjustTwoDigitYear(0)); assertEquals(2013, adjustTwoDigitYear(13)); assertEquals(2069, adjustTwoDigitYear(69)); assertEquals(1970, adjustTwoDigitYear(70)); assertEquals(1999, adjustTwoDigitYear(99)); assertEquals(100, adjustTwoDigitYear(100)); }