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:
- 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.
- when user selects city, use timezoneinfo.converttime method convert time , you're done.
there several different methods in timezoneinfo class , closer inspection solution.
Comments
Post a Comment