1
0
Fork 0
Browse Source

fix (#1): time not adjusting time zone.

The time (top-right) of dashboard was not updating to British Summer Time (BST). The change here adds a converision of the system's current/local time to match that of it current time zone. I should've done this at the beginning but here it's done now. And, most importantly, it's before the exhibition has started.
stable
Craig Oates 3 years ago
parent
commit
b899f66747
  1. 8
      src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs

8
src/EyesAndEars.UWP/EyesAndEars.UWP/Services/DataServices.cs

@ -15,6 +15,14 @@ namespace EyesAndEars.UWP.Services {
public static class DataServices {
static SpeechSynthesizer _synth = new SpeechSynthesizer();
public static string SetCurrentTime() {
var zone = TimeZoneInfo.Local;
var britishZone = TimeZoneInfo.FindSystemTimeZoneById(zone.Id);
var newDate = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local, britishZone);
return newDate.ToShortTimeString();
}
public static async Task<Device> UpdateDevice(string url, int deviceId,
RichTextBlock logs, string currentStatus, MediaElement audioUpdater, bool _logData) {
try {