Skip to main content

Brazilian daylight saving time

Project description

Um simples calculador das datas de início e fim do horário de verão brasileiro a partir de um ano especificado.

Instalando

pip install pybrdst

Como usar

Obtendo o início e fim do horário de verão:

from pybrdst.pybrdst import PyBrDST
dst = PyBrDST()
start, end = dst.get_dst(2017)
print(start)
2017-10-15 00:00:00
print(end)
2018-02-18 00:00:00

Obtendo somente o início do horário de verão:

from pybrdst.pybrdst import PyBrDST
dst = PyBrDST()
start = dst.begin_dst(2017)
print(start)
2017-10-15 00:00:00

Obtendo somente o fim do horário de verão:

Observe que a data informada será o fim que ocorreu ou ocorrerá no ano informado e não no ano seguinte

from pybrdst.pybrdst import PyBrDST
dst = PyBrDST()
end = dst.end_dst(2017)
print(end)
2017-02-19 00:00:00

Obtendo a data da Páscoa:

from pybrdst.pybrdst import PyBrDST
dst = PyBrDST()
easter_date = dst.easter_date(2017)
print(easter_date)
2017-04-16 00:00:00

Obtendo a data do carnaval:

from pybrdst.pybrdst import PyBrDST
dst = PyBrDST()
carnival_date = dst.carnival_date(dst.easter_date(2017))
print(carnival_date)
2017-02-28 00:00:00

Todos os retornos são do tipo datetime.datetime

Project details


Release history Release notifications

This version
History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pybrdst-0.1-py2-none-any.whl (2.9 kB) Copy SHA256 hash SHA256 Wheel py2
pybrdst-0.1-py2.py3-none-any.whl (3.1 kB) Copy SHA256 hash SHA256 Wheel py2.py3
pybrdst-0.1.tar.gz (1.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page