Commit 6daad39e authored by Robert Sebille's avatar Robert Sebille
Browse files

Rendre offset utc indépendant de l'heure serveur, DOC README.md

parent 22dc01d2
......@@ -13,6 +13,29 @@ __Below, in the same directory as this README file__
>>> <new instance> = AaaaHorodatageTools()
>>> <your code>
### Timezones
Your local timezone is stored in _utc_local_offset_ attribute
Default is +7200 seconds, that is to say +02:00; Europe/Brussels summertime
_utc_local_offset_ range: -43200 >= _utc_seconds_ <= +50400
You can use _get_utc_local_offset_ or _set_utc_local_offset_ public methods to get or set it (setter is now under construction).
#### Timezones sites
Some timezones sites can help you to determine tour timezone.
* [24timezones](https://24timezones.com/);
* [Time.is](https://time.is/time_zones)
* [Time_zone](https://en.wikipedia.org/wiki/Time_zone) on Wikipedia.
### Reference epoch
the reference epoch of the AaaaHorodatage class stored in _epoch_ class attribute
Default is 1900. Range: 0 <= _epoch_ <= 9999.
You can use _get_epoch_ or _set_epoch_ class methods to get or set it.
Please, be consistent with yourself! e.g., you must encode and decode the same timestamp with the same epoch; or the results will be incoherent. It's why this method is a class method.
Remember this: The only way to know what is the reference epoch of a time stamp, is to remember it.
### Help:
import aaaa.ahordattools
help(aaaa.ahordattools)
......
......@@ -54,7 +54,8 @@ class AaaaHorodatage:
def __init__(self):
# self.utc_local_offset = -7200
self.utc_local_offset = 7200
# self.utc_local_offset = 55000
self.utc_local_offset = 7200 # Europe/Brussels summertime
# private
# Liste nombre de jours par mois, moins décembre et année non bissextile
self._ljm = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
......@@ -259,7 +260,7 @@ class AaaaHorodatage:
"""Set the epoch of the AaaaHorodatage class.
Range: 0 <= epoch <= 9999.
Please, be consistent with yourself! e.g., you must encode
Please, be consistent with yourself! e.g., you must encode
and decode the same timestamp with the same epoch;
or the results will be incoherent. It's why this method is a
class method.
......@@ -285,7 +286,7 @@ class AaaaHorodatage:
# instance (self)
def get_utc_local_offset(self, typ=""):
"""Get the offset UTC for the server time.
"""Get the local UTC offset.
Return:
- Number of seconds (default)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment