Create an Accept-Datetime header object from a string
@param value the header value
@return an AcceptDatetime object or null if the value is not parseable
760896
public static AcceptDatetime valueOf(final String value) {
        final Optional<Instant> datetime = parseDatetime(value);
        if (datetime.isPresent()) {
            return new AcceptDatetime(datetime.get());
        }
        return null;
    }
1373454
public void setValue(final String value) throws ParseException {
        // value can be either a date-time or a date..
        if (Value.DATE.equals(getParameter(Parameter.VALUE))) {
            // ensure timezone is null for VALUE=DATE properties..
            updateTimeZone(null);
            this.date = new Date(value);
        } else if (value != null && !value.isEmpty()){
            this.date = new DateTime(value, timeZone);
        }
    }
281883
def parse_datetime(value):
    
    if not value:
        return None
    elif isinstance(value, datetime.datetime):
        return value
    return dateutil.parser.parse(value)
198144
public static ZonedDateTime zonedDateTimeOf(final String value) {
        try {
            return ZonedDateTime.parse(value);
        } catch (final Exception e) {
            return null;
        }
    }
907735
public static final Date parseDateTime(String value)
   {
      Date result = null;

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

      return result;
   }
827698
public static Date decodeDate(String value) throws ParseException {
		String javaValue = value.substring(0, value.length() - DECODE_DATE_COLONS_INDEX)
				+ value.substring(value.length() - ENCODE_DATE_COLONS_INDEX);
		SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
		dateFormatter.setTimeZone(TimeZone.getTimeZone(UTC_TZ_ID));
		return dateFormatter.parse(javaValue);
	}
1340455
def string_to_date(value):
    
    if isinstance(value, datetime.date):
        return value

    return dateutil.parser.parse(value).date()
1339078
public final void setValue(Object value) {
        if (value instanceof Date) {
            content = formatDateTime((Date)value);
        } else
            if (value != null) {
                content = value.toString();
            } else {
                content = null;
            }
    }
17380
public static Calendar read(String value) {
		Date date=DateUtils.read(value);
		
		Calendar calendar=Calendar.getInstance();
		calendar.setTime(date);
		
		return calendar;
	}
511962
private String formatDateTimeNull(Date value)
   {
      return (value == null ? m_formats.getNullText() : m_formats.getDateTimeFormat().format(value));
   }
254934
public static Version valueOf(final String value) {
        final Optional<Instant> time = parse(value);
        if (time.isPresent()) {
            return new Version(time.get());
        }
        return null;
    }
868489
public static HODate fromString(String value) {
        return StringUtils.isEmpty(value) ? null : new HODate(value);
    }
673583
public static Date getDate(
    Object   value)
  {
    if (value == null)
    {
        return null;
    }

    if (value instanceof Date)
    {
        return ((Date) value);
    }

    return parseISODate(value.toString());
  }
734415
function parseDate(value) {
  let date = value;
  if (!value) {
    return new Date().getTime();
  }
  if (isObject(date)) {
    date = date.value || date;
  }
  // array
  if (isArray(date)) {
    date = new Date(...date).getTime();
  } else {
    // string number  null 、''、undefined
    date = new Date(date).getTime();
  }
  if (date) {
    return date;
  }
  console.warn('Invalid Date ', value);
  return new Date().getTime();
}
256176
def to_nullable_string(value):
        
        if value == None:
            return None
        if type(value) == datetime.date:
            return value.isoformat()
        if type(value) == datetime.datetime:
            if value.tzinfo == None:
                return value.isoformat() + "Z"
            else:
                return value.isoformat()

        if type(value) == list:
            builder = ''
            for element in value:
                if len(builder) > 0:
                    builder = builder + ","
                builder = builder + element
            return builder.__str__()
        return str(value)
1108091
public static Date decodeDate(String value) throws ParseException {
        String javaValue = value.substring(0, value.length() - 3) + value.substring(value.length() - 2);
        SimpleDateFormat dateFormatter = new SimpleDateFormat(dateFormat);
        return dateFormatter.parse(javaValue);
    }
838321
public static function createFromInput($value)
    {
        $timestamp = strtotime($value);

        try {
            // trim java ms
            $value = preg_replace('`(\\.[0-9]{3})\\+`', '+', $value);

            $datetime = self::createFromFormat(self::DATE_FORMAT, $value);

            if ($timestamp != $datetime->getTimestamp()) {
                throw new ResponseCode("Invalid datetime with value '$value'", 422);
            }
        } catch (\Exception $exception) {
            throw new ResponseCode("Invalid datetime format with value '$value'", 422);
        }

        return $datetime;
    }