/// <summary> /// Constructs a new access policy condition that compares the current time /// (on the AWS servers) to the specified date. /// </summary> /// <param name="type">The type of comparison to perform. For example, /// DateComparisonType.DateLessThan will cause this policy /// condition to evaluate to true if the current date is less than /// the date specified in the second argument.</param> /// <param name="date">The date to compare against.</param> public static Condition NewCondition(DateComparisonType type, DateTime date) { return(new Condition(type.ToString(), CURRENT_TIME_CONDITION_KEY, date.ToString(AWSSDKUtils.ISO8601DateFormat))); }
/// <summary> /// Constructs a new access policy condition that compares the current time /// (on the AWS servers) to the specified date. /// </summary> /// <param name="type">The type of comparison to perform. For example, /// DateComparisonType.DateLessThan will cause this policy /// condition to evaluate to true if the current date is less than /// the date specified in the second argument.</param> /// <param name="date">The date to compare against.</param> public static Condition NewConditionUtc(DateComparisonType type, DateTime date) { return(new Condition(type.ToString(), CURRENT_TIME_CONDITION_KEY, date.ToUniversalTime().ToString(AWSSDKUtils.ISO8601DateFormat, CultureInfo.InvariantCulture))); }
public static Condition NewCondition(DateComparisonType type, DateTime date) { return(new Condition(type.ToString(), "aws:CurrentTime", date.ToString("yyyy-MM-dd\\THH:mm:ss.fff\\Z", CultureInfo.InvariantCulture))); }
/// <summary> /// Constructs a new access policy condition that compares the current time /// (on the AWS servers) to the specified date. /// </summary> /// <param name="type">The type of comparison to perform. For example, /// DateComparisonType.DateLessThan will cause this policy /// condition to evaluate to true if the current date is less than /// the date specified in the second argument.</param> /// <param name="date">The date to compare against.</param> public static Condition NewCondition(DateComparisonType type, DateTime date) { return new Condition(type.ToString(), CURRENT_TIME_CONDITION_KEY, date.ToString(AWSSDKUtils.ISO8601DateFormat)); }