Amazon.S3.Util.AmazonS3Util.ParseExpiresHeader C# (CSharp) Method

ParseExpiresHeader() static private method

static private ParseExpiresHeader ( string rawValue, string requestId ) : DateTime?
rawValue string
requestId string
return DateTime?
        internal static DateTime? ParseExpiresHeader(string rawValue, string requestId)
        {
            if (!string.IsNullOrEmpty(rawValue))
            {
                try
                {
                    return S3Transforms.ToDateTime(rawValue);
                }
                catch (FormatException e)
                {
                    throw new AmazonDateTimeUnmarshallingException(
                        requestId,
                        string.Empty,
                        string.Empty,
                        rawValue,
                        message: string.Format(
                            CultureInfo.InvariantCulture,
                            "The value {0} cannot be converted to a DateTime instance.",
                            rawValue),
                        innerException: e);
                }
            }
            else
            {
                return default(DateTime);
            }
        }