Skip to content

Commit

Permalink
EssentialsDate ToString methods should be culture invariant when no c…
Browse files Browse the repository at this point in the history
…ulture is specified
  • Loading branch information
abjerner committed Apr 7, 2024
1 parent 09f3dc0 commit 782e932
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Skybrud.Essentials/Time/EssentialsDate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public EssentialsTime GetEndOfQuarter(TimeZoneInfo timeZone) {
/// </summary>
/// <returns>A string representation of the value of the current <see cref="EssentialsDate"/> object.</returns>
public override string ToString() {
return _dateTime.ToString("yyyy-MM-dd");
return _dateTime.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
}

/// <summary>
Expand All @@ -429,7 +429,7 @@ public override string ToString() {
/// <param name="format">A standard or custom date and time format string.</param>
/// <returns>A string representation of value of the current <see cref="EssentialsDate"/> object as specified by <paramref name="format"/>.</returns>
public string ToString([StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format) {
return _dateTime.ToString(format);
return _dateTime.ToString(format, CultureInfo.InvariantCulture);
}

/// <summary>
Expand Down

0 comments on commit 782e932

Please sign in to comment.