Giter VIP home page Giter VIP logo

timezones's Introduction

Timezones

Timezone related functions to get the correct settings of the tzData used by Mongoose-OS. Inspired and based on a blog posting from Pavel Gurenko "Getting POSIX TZ strings from Olson tzdata". The library will only use the current timezone settings and is not able to track changes in timezone data.

This is a library written in C which works in the background. Just add the lib, set your personal values in mos.yml and build the app.

the setting 'Europe/Berlin' will result in 'CET-1CEST,M3.5.0,M10.5.0/3'

Usage:

1. Include library in mos.yml

2. Adapt you settings:

  - ["timezone.enable", true]

You may enable/disable the library though it is loaded.

  - ["timezone.data_path", "/mnt"]

If you have mounted an additional file system with e.g. the name /mnt, you may move the ZIP file (~5KB) to the file system you entered here. It must by mounted before. This will only be executed after flashing a new version of the firmware. After this action the moved file will be used. Be aware that after moving the archive file you should not change this setting without a new build and flash, because this will lead to an error finding the file. Be aware: if you want to let the data untouched and let it stay where it is, please set this value to an empty string "". In this case, the ZIP file will be in the standard file system

  - ["timezone.arch_file", "tz-archive.zip"]

This is the filename of the timezone data archive, should not be touched.

  - ["timezone.olson", "UTC0"]

Here you may enter the wished timezone in Olson notation you wish to be configured for your device. For example: if you enter America/New_York, the sys.tz_spec will be set to EST5EDT,M3.2.0,M11.1.0

3. ToDo:

  • comment the source code
  • add update possibilities, because the timezone data changes from time to time
  • implement some functions in MJS for information purposes
  • implement a function which will retrieve the timezone from coordinates (longitude, latitude)
  • implement a function which will get the timezone from a full address (e.g. via GoogleAPI)

timezones's People

Contributors

mamuesp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.