private static bool TryParseDateHeader(AmazonServiceException ase, out DateTime serverTime)
{
var webData = GetWebData(ase);
if (webData != null)
{
// parse server time from "Date" header, if possible
var dateValue = webData.GetHeaderValue(HeaderKeys.DateHeader);
if (!string.IsNullOrEmpty(dateValue))
{
if (DateTime.TryParseExact(
dateValue,
AWSSDKUtils.GMTDateFormat,
CultureInfo.InvariantCulture,
DateTimeStyles.AssumeUniversal,
out serverTime))
{
return true;
}
}
}
serverTime = DateTime.MinValue;
return false;
}
private static bool TryParseExceptionMessage(AmazonServiceException ase, out DateTime serverTime)