0

Because I am writing new app, where User will set up the time for some devices, I start thinking about timezones and DST - especially when DST started and ended in some countries.

So how to do it? At first I look when DST change in which countries. Some don't change DST times and EU change different than US. What about other countries (Asia, Australia, Africa)? Is where hole database about when some country change its time (for every time zone or so)? And DST change is always for one hour? Or how is better to do? That user select timezone and in background to have some database?

So first I like to know how the world "runs" and then how to implement this in to application. Exist any .dll already for this? Thanks!

Please for help. If any questions, please ask!

Time and Clock Changes - City Loopup

esispaned
  • 283
  • 5
  • 20
  • 3
    Your question is *really* broad at the moment, making it very hard to answer. You should probably look at the `TimeZoneInfo` class, although I personally prefer the support we have in my [Noda Time](http://nodatime.org) library. – Jon Skeet Jul 29 '15 at 13:08
  • 2
    All computers store time as UTC time (Greenwich England). The default DATETIME input and output methods automatically convert time to local time based on the computer TimeZone settings. The only time you have to make any adjustments is if you are either input or output in a different timezone than the computer settings. For example if you collect data in Asia and entering the data in England you would have to indicate the data was Asian time. – jdweng Jul 29 '15 at 13:11
  • 2
    @jdweng sory to be a pedant, but GMT != UTC. They just happen to be in sync. – Jamiec Jul 29 '15 at 13:11
  • 1
    There is some other complexity too [*A one-hour shift is customary, but Australia's Lord Howe Island uses a half-hour shift. Twenty-minute and two-hour shifts have been used in the past.*](https://en.wikipedia.org/wiki/Daylight_saving_time), and the [rules are intricate, to say the least](https://en.wikipedia.org/wiki/Daylight_saving_time_by_country) – Jamiec Jul 29 '15 at 13:14
  • 1
    Oh, and don't forget there are different sources of time zone data. The Windows time zone database is quite different from the IANA-maintained one that most Unix systems use. – Jon Skeet Jul 29 '15 at 13:16
  • Jon : Don't get ascii time confused with numeric time. Unix and Windows can get time over internet from same time servers so unix and windows time can be the same. – jdweng Jul 29 '15 at 13:34
  • Jamiec : I wasn't describing time down to the leap second. GPS time is different from both GMT and UTC. Time in space is different than time on earth. – jdweng Jul 29 '15 at 13:36
  • 1
    Read [the timezone tag wiki](http://stackoverflow.com/tags/timezone/info), and the [DST & TZ Best Practices](http://stackoverflow.com/a/2532962/634824). You might also consider my [Date and Time Fundamentals](http://www.pluralsight.com/courses/date-time-fundamentals) video course. But the question is too broad and shows no research effort, so I'm voting to close. – Matt Johnson-Pint Jul 29 '15 at 16:50

0 Answers0