c# - World Time Widget - Display the time in a city -


i need implement world time widget allow user select city, hit button , display time in city them.

has got pointers me please?

take @ timezoneinfo class (msdn link). class, introduced in .net 3.5 handles of heavy lifting you.

the steps you're asking follows:

  1. in dropdown list of cities, set value each city timezoneinfo displayname. see here how use timezoneinfo.getsystemtimezones method. take bit of work but, thanksfully, you'll have once.
  2. when user selects city, use timezoneinfo.converttime method convert time , you're done.

there several different methods in timezoneinfo class , closer inspection solution.


Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -