Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DS4Windows/DS4Control/DTOXml/AppSettingsDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand Down Expand Up @@ -239,10 +240,10 @@ public DateTime LastChecked
[XmlElement("LastChecked")]
public string LastCheckString
{
get => LastChecked.ToString("MM/dd/yyyy HH:mm:ss");
get => LastChecked.ToString("MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
set
{
if (DateTime.TryParse(value, out DateTime temp))
if (DateTime.TryParse(value, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime temp))
{
LastChecked = temp;
}
Expand Down
3 changes: 2 additions & 1 deletion DS4WindowsTests/AppSettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License

using System.Configuration;
using System;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
Expand Down Expand Up @@ -131,7 +132,7 @@ public void CheckSettingsRead()
dto.MapTo(tempStore);

// Check settings
DateTime.TryParse(dto.LastCheckString, out DateTime tempLastChecked);
DateTime.TryParse(dto.LastCheckString, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime tempLastChecked);
Assert.AreEqual(tempLastChecked, tempStore.lastChecked);
}

Expand Down
Loading