I'm trying to know if there is a way to make a DateTime
object get all the right properties on a OS that is set to GMT time. Not just changing time.
Right now what im doing is:
DateTime f = new DateTime(2012, 8, 1); //A date on summer
DateTime f2 = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(f, TimeZoneInfo.Local.Id, "Central Europe Standard Time");
var isSummer = f2.IsDaylightSavingTime(); //It always returns false if the OS is on GMT
And it changes the hour & date to make the GMT become Central Europe Standard Time just fine, but the IsDaylightSavingTime
function wont work. It always returns false because I'm using GMT on the system, but i think it shouldn't because I created a DateTime
for central Europe.
Is there a way to make the DateTime
object f2
really local and make it understand that if its August and is European Central it should return true instead of false?
I know if I use local time on the machine it would work OK, but I cant change the GMT time on the server. I would love to, but I cant. :-)