{
millis = Long.parseLong(source);
}
catch (NumberFormatException e)
{
throw new MarshalException(String.format("unable to make long (for date) from: '%s'", source), e);
}
}
// Last chance, attempt to parse as date-time string
else
{
try
{
millis = DateUtils.parseDateStrictly(source, TimestampSerializer.iso8601Patterns).getTime();
}
catch (ParseException e1)
{
throw new MarshalException(String.format("unable to coerce '%s' to a formatted date (long)", source), e1);
}
}
return millis;
}