how to get the datetime information representing the currenttime zone after the changing the timezone(this time zone change happens when application is running)?

Отвечено how to get the datetime information representing the currenttime zone after the changing the timezone(this time zone change happens when application is running)?

  • 8 августа 2012 г. 18:15
     
     

    Problem Facing with datetime

    1.I have started my application with timezone 1(stand alone app)

    2.i am using the datetime.now to get the current datetime.this time it is returning time with respect to timezone 1

    3.Now i will change the timezone of my system to time zone 2 without stopping my application

    4Now my datetime.now returns the current time with respect to timezone 1 not with respect to timezone 2(even the timezoneinfo.local is set to timezone 1)

    i have tried it by clearing the system.globalization.culture.currentculture.clearcacheddata and also timezoneinfo.clearcacheddata but i have a problem with these

    after i picking the datetime as local time i need to convert this date into other reference timezone 3.

    if iam using the above clearing methods the convertion function is failing

    Could any please resolve this issue.

    thanks in advance

Все ответы