获取日期

@param value 单元格值
@return 日期
@since 4.1.0
557848
private static DateTime getDateValue(String value) {
		return DateUtil.date(org.apache.poi.ss.usermodel.DateUtil.getJavaDate(Double.parseDouble(value), false));
	}
181921
function (value) {

      if(value === undefined) return null;

      if(value instanceof Date) {
         return value;
      }

      var date = null, replace, regex, a = 0, length = helpers.date.regex.length;

      value = value.toString();

      for(a; a < length; a++) {
         regex = helpers.date.regex[a];

         if(value.match(regex.test)) {

            if(regex.replace.indexOf("-") > -1){
               replace = value.replace(regex.test, regex.replace).split("-");
               date = new Date(parseInt(replace[0]), parseInt(--replace[1]), parseInt(replace[2]));
            }
            else {
               replace = parseInt(value.replace(regex.test, regex.replace));
               date = new Date(replace);
            }

            break;
         }
      }

      return date;
   }
531548
public String marshal( Date value )
    {
        Timestamp timeStampDate = new Timestamp( value.getTime() );
        return timeStampDate.toString();
    }
857945
public static DateTime toDateTime(Timestamp value) {
        if (value == null) {
            return null;
        } else {
            return new DateTime(value.getTime(), DateTimeZone.UTC);
        }
    }
431204
public static final Date parseExtendedAttributeDate(String value)
   {
      Date result = null;

      if (value != null)
      {
         try
         {
            result = DATE_FORMAT.get().parse(value);
         }

         catch (ParseException ex)
         {
            // ignore exceptions
         }
      }

      return (result);
   }
264936
function parseValue(value) {
  const date = new Date(parseDate(value));
  let timeType;
  if (value && value.timeType) {
    timeType = ({ AM: 0, PM: 1 })[value.timeType || 'AM'];
  } else {
    timeType = date.getHours() >= 12 ? 1 : 0;
  }
  return [
    date.getFullYear(),
    date.getMonth(),
    date.getDate(),
    timeType,
    date.getHours() >= 13 ? date.getHours() - 12 : date.getHours(), // 12小时制
    date.getHours(),
    date.getMinutes(),
    date.getSeconds(),
    // 获取年月日组合，转换成number
    `${date.getFullYear()}${addZero(date.getMonth() + 1)}${addZero(date.getDate())}` - 0,
    `${date.getFullYear()}${addZero(date.getMonth() + 1)}${addZero(date.getDate())}` - 0,
  ];
}
6567
public static Date parse(String value) {
        try {
            return STANDARD_DATE_FORMAT.get().parse(value);
        } catch (ParseException ignore) {
        }
        for (String formatString : BROWSER_COMPATIBLE_DATE_FORMATS) {
            try {
                return new SimpleDateFormat(formatString, Locale.US).parse(value);
            } catch (ParseException ignore) {
            }
        }
        return null;
    }
972454
private static boolean isDate(String value) {
    try {
      new SimpleDateFormat("yyyyMMddHHmmss").parse(value);
      return true;
    } catch (ParseException e) {
      return false;
    }
  }
760896
public static AcceptDatetime valueOf(final String value) {
        final Optional<Instant> datetime = parseDatetime(value);
        if (datetime.isPresent()) {
            return new AcceptDatetime(datetime.get());
        }
        return null;
    }
950408
public static String formatDate(final Date value, final String pattern)
    {
        return new SimpleDateFormat(pattern, currentLocale()).format(value);
    }
673519
public static AcceptDatetime valueOf(final String value) {
        if (value != null) {
            final Instant time = parseDatetime(value);
            if (time != null) {
                return new AcceptDatetime(time);
            }
        }
        return null;
    }
893091
function(value, parameters) {
            if(!(value instanceof Date))
                value = new Date(value);

            if(value.date_only || parameters['VALUE'] === 'DATE')
                return format_value('DATE', value);

            return value.getUTCFullYear()
                    +pad(value.getUTCMonth()+1)
                    +pad(value.getUTCDate())
                    +'T'+format_value('TIME', value);
        }
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;
	}
286356
private static Calendar valueAsCalendar(Object value) {
		Date date = (Date) value;
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal;
	}
392533
public static java.sql.Time getTime(Object value) {
        try {
            return toTime(value);
        } catch (ParseException pe) {
            pe.printStackTrace();
            return null;
        }
    }
890844
public static final Date parseDate(String value)
   {
      Date result = null;

      try
      {
         if (value != null && !value.isEmpty())
         {
            result = DATE_FORMAT.get().parse(value);
         }
      }
      catch (ParseException ex)
      {
         // Ignore
      }

      return result;
   }
228425
def timestamp(value):
    
    value = value if timezone.is_naive(value) else timezone.localtime(value)
    return value.strftime(settings.DATE_FORMAT)