Parse a timestamp value.

@param value string representation
@return date value
11058
public static final Date parseTimestamp(String value)
   {
      Date result = null;

      if (value != null && value.length() != 0)
      {
         try
         {
            result = TIMESTAMP_FORMAT.get().parse(value);
         }

         catch (ParseException ex)
         {
            // Ignore parse exception
         }
      }

      return (result);
   }
906481
public static java.util.Date toDateTime(Object value) throws ParseException {
        if (value == null) {
            return null;
        }
        if (value instanceof java.util.Date) {
            return (java.util.Date) value;
        }
        if (value instanceof String) {
            if ("".equals((String) value)) {
                return null;
            }
            return IN_DATETIME_FORMAT.parse((String) value);
        }

        return IN_DATETIME_FORMAT.parse(value.toString());
    }
904760
def parse_timestamp(x):
    """"""
    dt = dateutil.parser.parse(x)
    if dt.tzinfo is None:
        dt = dt.replace(tzinfo=pytz.utc)
    return dt
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);
   }
1201641
public static java.sql.Timestamp toTimestamp(Object value) throws ParseException {
        if (value == null) {
            return null;
        }
        if (value instanceof java.sql.Timestamp) {
            return (java.sql.Timestamp) value;
        }
        if (value instanceof String) {

            if ("".equals((String) value)) {
                return null;
            }
            return new java.sql.Timestamp(IN_TIMESTAMP_FORMAT.parse((String) value).getTime());
        }

        return new java.sql.Timestamp(IN_TIMESTAMP_FORMAT.parse(value.toString()).getTime());
    }
1115796
public Date unmarshal(String value) {
		
		if (value != null) {
			
			if (value.length() >= lengthOfDateFmtYYYY_MM_DD) {
				//Extract just the date from the string YYYY-MM-DD
				value = value.substring(0, lengthOfDateFmtYYYY_MM_DD);
				boolean isMatch = value.matches(datePattern);
				if (isMatch) {
					return DatatypeConverter.parseDate(value).getTime();
				} else {
					return DatatypeConverter.parseDate(INVALIDDATE).getTime();
				}
			} else {
				return DatatypeConverter.parseDate(INVALIDDATE).getTime();
			}
		} else {
			return null;
		}
	}
228425
def timestamp(value):
    
    value = value if timezone.is_naive(value) else timezone.localtime(value)
    return value.strftime(settings.DATE_FORMAT)
17380
public static Calendar read(String value) {
		Date date=DateUtils.read(value);
		
		Calendar calendar=Calendar.getInstance();
		calendar.setTime(date);
		
		return calendar;
	}
1015696
public static Timestamp parseTimestamp(String timestamp) {
    TemporalAccessor temporalAccessor = timestampParser.parse(timestamp);
    Instant instant = Instant.from(temporalAccessor);
    return ofTimeSecondsAndNanos(instant.getEpochSecond(), instant.getNano());
  }
703150
public Date parseDateTime( String str ) throws java.text.ParseException
  {
    if( str == null )
    {
      return null;
    }

    return DateFormat.getDateInstance().parse(str);
  }
168850
private String formatDate(Date value)
   {
      return (value == null ? null : m_formats.getDateFormat().format(value));
   }
29154
public BitemporalDateTime parseBitemporalDate(Object value) {
        Date date = parser.parse(value);
        return date == null ? null : checkIfNow(date.getTime());
    }
1360681
@Override
    public String getString(Object value) {
        try {
            return DATE_TIME_FORMAT.format(value);
        } catch (IllegalArgumentException ignore) {
            // There's not much that can be done.
        }
        return StringValues.TO_STRING.getString(value);
    }
967883
private Date getDateTime(String value) throws MPXJException
   {
      try
      {
         Number year = m_fourDigitFormat.parse(value.substring(0, 4));
         Number month = m_twoDigitFormat.parse(value.substring(4, 6));
         Number day = m_twoDigitFormat.parse(value.substring(6, 8));

         Number hours = m_twoDigitFormat.parse(value.substring(9, 11));
         Number minutes = m_twoDigitFormat.parse(value.substring(11, 13));

         Calendar cal = DateHelper.popCalendar();
         cal.set(Calendar.YEAR, year.intValue());
         cal.set(Calendar.MONTH, month.intValue() - 1);
         cal.set(Calendar.DAY_OF_MONTH, day.intValue());

         cal.set(Calendar.HOUR_OF_DAY, hours.intValue());
         cal.set(Calendar.MINUTE, minutes.intValue());

         cal.set(Calendar.SECOND, 0);
         cal.set(Calendar.MILLISECOND, 0);
         Date result = cal.getTime();
         DateHelper.pushCalendar(cal);
         
         return result;
      }

      catch (ParseException ex)
      {
         throw new MPXJException("Failed to parse date-time " + value, ex);
      }
   }
423210
public static Duration parse(String value) {
		/*
		 * Implementation note: Regular expressions are not used to improve
		 * performance.
		 */

		if (value.length() == 0) {
			throw parseError(value);
		}

		int index = 0;
		char first = value.charAt(index);
		boolean prior = (first == '-');
		if (first == '-' || first == '+') {
			index++;
		}

		if (value.charAt(index) != 'P') {
			throw parseError(value);
		}

		Builder builder = new Builder();
		builder.prior(prior);

		StringBuilder buffer = new StringBuilder();
		for (int i = index + 1; i < value.length(); i++) {
			char c = value.charAt(i);

			if (c == 'T') {
				/*
				 * A "T" character is supposed to immediately precede the time
				 * component value(s). It is required by the syntax, but not
				 * really necessary. Ignore it.
				 */
				continue;
			}

			if (c >= '0' && c <= '9') {
				buffer.append(c);
				continue;
			}

			if (buffer.length() == 0) {
				throw parseError(value);
			}

			Integer num = Integer.valueOf(buffer.toString());
			buffer.setLength(0);

			switch (c) {
			case 'W':
				builder.weeks(num);
				break;
			case 'D':
				builder.days(num);
				break;
			case 'H':
				builder.hours(num);
				break;
			case 'M':
				builder.minutes(num);
				break;
			case 'S':
				builder.seconds(num);
				break;
			default:
				throw parseError(value);
			}
		}

		return builder.build();
	}
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;
    }
476929
public static final Date parseTime(String value)
   {
      Date result = null;
      if (value != null && value.length() != 0)
      {
         try
         {
            result = TIME_FORMAT.get().parse(value);
         }

         catch (ParseException ex)
         {
            // Ignore parse errors
         }
      }
      return result;
   }