Retrieves the year from a {@link CSLDate} object. Parses the raw
string if necessary.
@param date the date object
@param dateParser a date parser
@return the year or -1 if the year could not be retrieved
320789
private static int getYear(CSLDate date, CSLDateParser dateParser) {
		if (date == null) {
			return -1;
		}
		if (date.getDateParts() == null ||
				date.getDateParts().length == 0 ||
				date.getDateParts()[0] == null ||
				date.getDateParts()[0].length == 0) {
			if (date.getRaw() != null && !date.getRaw().isEmpty()) {
				CSLDate d = dateParser.parse(date.getRaw());
				return getYear(d, dateParser);
			}
			return -1;
		}
		return date.getDateParts()[0][0];
	}
10092
public static Date addYear(Date date1, int addYear) {
        Date resultDate = null;
        Calendar c = Calendar.getInstance();
        c.setTime(date1); // 设置当前日期
        c.add(Calendar.YEAR, addYear); // 日期加1
        resultDate = c.getTime(); // 结果
        return resultDate;
    }
173468
public Date getDate() {
        for (int i = 0; i < info.length() - 9; i++) {
            if (Character.isWhitespace(info.charAt(i))) {
                String dateString = info.substring(i + 1, i + 9);
                try {
                    synchronized (formatter) {
                        return formatter.parse(dateString);
                    }
                } catch (ParseException pe) {
                }
                break;
            }
        }
        return null;
    }
157893
public static Date parseAWSDate(String date) {
		if (date == null) {
			return null;
		}
		return TIME_FORMATTER.parseDateTime(date).toDate();
	}
225034
public static LocalDate firstDay(String localDate) {
        LocalDate parse = parse(localDate, DEFAULT_PATTERN);
        return LocalDate.of(parse.getYear(), parse.getMonth(), 1);
    }
1126643
public static String getStringFromDateTime(Date date) throws ParseException {
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_yyyyMMddTHHmmssSSSZone);
        return formatter.format(date);
    }
1142746
public static int year(EvaluationContext ctx, Object date) {
        return Conversions.toDateOrDateTime(date, ctx).get(ChronoField.YEAR);
    }
1052726
function getDayOfYear (date, year) {
  date = toStringDate(date)
  if (baseExports.isDate(date)) {
    return baseExports.isLeapYear(getWhatYear(date, year)) ? 366 : 365
  }
  return date
}
1176971
public static int getYearFromData(Date date) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.YEAR);
	}
585587
public static LocalDateTime firstDay(String localDate) {
        LocalDateTime parse = parse(localDate, DEFAULT_PATTERN);
        return LocalDateTime.of(parse.getYear(), parse.getMonth(), 1, 0, 0, 0);
    }
798392
public String getDate(Date date) {

        return CmsDateTimeUtil.getDate(date, CmsDateTimeUtil.Format.SHORT);
    }
1032446
public void setYearlyAbsoluteFromDate(Date date)
   {
      if (date != null)
      {
         Calendar cal = DateHelper.popCalendar(date);
         m_dayNumber = Integer.valueOf(cal.get(Calendar.DAY_OF_MONTH));
         m_monthNumber = Integer.valueOf(cal.get(Calendar.MONTH) + 1);
         DateHelper.pushCalendar(cal);
      }
   }
1106526
function isLeapYear (date) {
  var year
  var currentDate = date ? XEUtils.toStringDate(date) : new Date()
  if (isDate(currentDate)) {
    year = currentDate.getFullYear()
    return (year % 4 === 0) && (year % 100 !== 0 || year % 400 === 0)
  }
  return false
}
137974
public static java.sql.Date toSqlDate(int month, int day, int year) {
		java.util.Date newDate = toDate(month, day, year, 0, 0, 0);

		if (newDate != null)
			return new java.sql.Date(newDate.getTime());
		else
			return null;
	}
1254199
public static Date getYear(String string) {
		if (string == null) {
			return null;
		}
		Date date = null;
		try {
			date = ((SimpleDateFormat)year.clone()) .parse(string);
		}
		catch (ParseException ex) {
			return null;
		}
		return date;
	}
523569
public int getEraYear(final Calendar cal) {
        ArgUtils.notNull(cal, "cal");
        
        final Calendar startCal = Calendar.getInstance(TimeZone.getTimeZone("GMT-00:00"));
        startCal.setTime(startDate);
        
        final int diff = cal.get(Calendar.YEAR) - startCal.get(Calendar.YEAR) + 1;
        return diff;
        
    }
1045689
public Date dateValue(String date) {
		Date value = null;
		if (date != null) {

			// Try each simple date formatter in order
			ParseException exception = null;
			for (SimpleDateFormat sdf : formatters) {
				try {
					synchronized (sdf) {
						value = sdf.parse(date);
					}
					break;
				} catch (ParseException e) {
					if (exception == null) {
						exception = e;
					}
				}
			}

			// If no value could be parsed throw the first expected parse
			// format exception
			if (value == null) {
				throw new GeoPackageException("Failed to parse date string: "
						+ date, exception);
			}

		}
		return value;
	}