Hello All,
I am having an C#.Net windows application.The re I am using WMI class Win32_Operating System to get the information of operating system. In this class we are having a Parameter Called "LocalDateTime" .
If the time zone is "(GMT+5:30) chennai,kolkata ,Mumbai,Newdelh i" we will get localdatetime from WMI as "20070327182923 .82800+330" . This value I have converted to datetime by using ManagementDateT imeConverter
DateTime Dt;
Dt = ManagementDateT imeConverter.To DateTime
string strFormatedDate = Dt.ToString("MM M/dd/yyyy hh:mm:ss tt");
("2007032718292 3.82800+330"); This is working fine and giving the result like Mar/27/2008 06:29:23
the problem comes If I change the Time zone, Then i tried get the localdatetime dynamically , WMI is returning the correct value , but the ManagementDateT imeConverter is not giving the correct value.It is giving the previous time zone value only.
But when i close the appliaction and run it again then it is giving current timezone time what ever we have selected.
What is the problem here? can anyone give any solution to get current time zone time.
Thanks in advance...
I am having an C#.Net windows application.The re I am using WMI class Win32_Operating System to get the information of operating system. In this class we are having a Parameter Called "LocalDateTime" .
If the time zone is "(GMT+5:30) chennai,kolkata ,Mumbai,Newdelh i" we will get localdatetime from WMI as "20070327182923 .82800+330" . This value I have converted to datetime by using ManagementDateT imeConverter
DateTime Dt;
Dt = ManagementDateT imeConverter.To DateTime
string strFormatedDate = Dt.ToString("MM M/dd/yyyy hh:mm:ss tt");
("2007032718292 3.82800+330"); This is working fine and giving the result like Mar/27/2008 06:29:23
the problem comes If I change the Time zone, Then i tried get the localdatetime dynamically , WMI is returning the correct value , but the ManagementDateT imeConverter is not giving the correct value.It is giving the previous time zone value only.
But when i close the appliaction and run it again then it is giving current timezone time what ever we have selected.
What is the problem here? can anyone give any solution to get current time zone time.
Thanks in advance...
Comment