示例#1
0
 /// <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)));
 }
示例#2
0
 /// <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)));
 }
示例#3
0
 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)));
 }
示例#4
0
 /// <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));
 }