Giter Club home page Giter Club logo

timezones's Introduction

timezones

List of current timezones and the python to generate it. Useful for generating a list of possible timezones for a user to select on a device that simply needs to track time via NTP or a realtime clock.

Usage

python timezones.py > timezones.json

Caveats

It simply picks a date in winter and a date in summer for each timezone available from pytz (derived from IANA data), and determines the offset from GMT. It then groups all timezones that have the same offset(s) together. It's possible that some timezones that observe daylight savings time are grouped together, but have different rules for when DST applies. For example, one one TZ, it may start on the first Sunday in March. In another TZ, it may start on the second Monday. These two will be grouped together if they have the same offset for the winter and summer dates tested (January 1 and July 1). Because of this, it's probably best to allow a user to select any TZ that doesn't use DST, and add timezones that do use DST on an as-needed basis.

Further work

It is possible to derive the DST transition rules from the pyTZ library. This could be used to provide accurate groupings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.