You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When RetentionUntilDate property in SetObjectRetentionArgs class serialized, it formatted to ISO 8601 string, but time zone offset get lost.
public static string To8601String(DateTime dt)
{
return dt.ToString("yyyy-MM-dd'T'HH:mm:ssZ", CultureInfo.InvariantCulture);
}
As result if date in local time zone, minio server received date in past or future depending on time zone.
I tried pass date in UTC, but get error, because passed value checked against local time (DateTime.Now) always
if (DateTime.Compare(RetentionUntilDate, DateTime.Now) <= 0)
throw new InvalidOperationException("Retention until date set using " + nameof(WithRetentionUntilDate) +
" needs to be in the future.");
The text was updated successfully, but these errors were encountered:
adcy
added a commit
to adcy/minio-dotnet
that referenced
this issue
Jul 31, 2023
When RetentionUntilDate property in SetObjectRetentionArgs class serialized, it formatted to ISO 8601 string, but time zone offset get lost.
As result if date in local time zone, minio server received date in past or future depending on time zone.
I tried pass date in UTC, but get error, because passed value checked against local time (DateTime.Now) always
The text was updated successfully, but these errors were encountered: