C# Time localZone DaylightName/StandardName - GetUtcOffset

  • Thread starter Thread starter Markus Freitag
  • Start date Start date
M

Markus Freitag

Guest
Hello,
my problem is, on my developer PC all is right.
// : StandardName = Mitteleuropäische Zeit, DayLightName= Mitteleuropäische Sommerzeit, 02:00:00
// : + Time start= 2019-06-25T10:11:13+02:00
1454132.jpg
on customer PC
on my developer PC all is rigth.
// : + Time start= 2019-06-25T11:11:13+01:00
One hour more and only +1

Same settings on Windows hour.
What can be the cause, solution?
Wrong code?
Are there any other attitudes that can influence that? Net time server?
If a network server is active, are the local settings not relevant? How I can check this?


// From Internet

// Here is my code!
TimeZone localZone = TimeZone.CurrentTimeZone;
TimeSpan currentOffset = localZone.GetUtcOffset(currentDate);
string dateUTCOffset = (currentOffset.Ticks < 0 ? "-" : "+") + currentOffset.ToString("hh\\:mm");
Trace.Writeline($"StandardName = {localZone.StandardName}, DayLightName= {localZone.DaylightName}, {currentOffset}");

// StandardName = Osteuropäische Zeit, DayLightName= Osteuropäische Zeit, 02:00:00
// + Time start= 2019-06-25T09:46:02+02:00

// : + --------------------------------------------
// : StandardName = Mitteleuropäische Zeit, DayLightName= Mitteleuropäische Sommerzeit, 02:00:00
// : Time start= 2019-06-25T10:11:13+02:00



Best regards Markus

Continue reading...
 
Back
Top