Skip to content

Commit

Permalink
Fix DateTime parse exception (#292)
Browse files Browse the repository at this point in the history
Fixes #291
  • Loading branch information
poornas authored and nitisht committed Mar 15, 2019
1 parent 2fe2d29 commit 1865257
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Minio/ApiEndpoints/ObjectOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using RestSharp;

using System.Threading.Tasks;
Expand Down Expand Up @@ -802,7 +803,7 @@ private async Task<List<DeleteError>> removeObjectsAsync(string bucketName, List
}
else if (parameter.Name.Equals("Last-Modified", StringComparison.OrdinalIgnoreCase))
{
lastModified = DateTime.Parse(parameter.Value.ToString());
lastModified = DateTime.Parse(parameter.Value.ToString(), CultureInfo.InvariantCulture);
}
else if (parameter.Name.Equals("ETag", StringComparison.OrdinalIgnoreCase))
{
Expand Down
3 changes: 2 additions & 1 deletion Minio/DataModel/Bucket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

using System;
using System.Globalization;

namespace Minio.DataModel
{
Expand All @@ -26,7 +27,7 @@ public class Bucket

public DateTime CreationDateDateTime {
get {
return DateTime.Parse(this.CreationDate);
return DateTime.Parse(this.CreationDate, CultureInfo.InvariantCulture);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Minio/DataModel/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

using System;
using System.Globalization;

namespace Minio.DataModel
{
Expand Down Expand Up @@ -54,7 +55,7 @@ public DateTime? LastModifiedDateTime
DateTime? dt = null;
if(!string.IsNullOrEmpty(this.LastModified))
{
dt = DateTime.Parse(this.LastModified);
dt = DateTime.Parse(this.LastModified, CultureInfo.InvariantCulture);
}
return dt;
}
Expand Down

0 comments on commit 1865257

Please sign in to comment.