Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Could you please help me, I gave input as DispalyName (eg:(GMT-06:00) Central America
) then i want to get current date and time .
Posted

This is works on .net 4.0, In TimeZoneInfo class doesn't have a FindSytemTimeZone method in metro style apps. So how to do this in metro style apps...

string ZoneId = "Central America";
DateTime localtime = DateTime.Now;
TimeZoneInfo timeZoneInfo = System.TimeZoneInfo.FindSystemTimeZoneById(ZoneId);
DateTime dataTimeByZoneId = System.TimeZoneInfo.ConvertTime(localtime, System.TimeZoneInfo.Local, timeZoneInfo);
return dataTimeByZoneId;
 
Share this answer
 
v2
use callisto [^] controls
 
Share this answer
 
You must see this post How to Find Date and Time by Time Zone using c#

It's a very nice implementation! Works in all type of .NET projects.

Hope it helps.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900