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 | RSS feed

This version

0.1

Download files

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

Source Distribution

pybrdst-0.1.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distributions

pybrdst-0.1-py2.py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 2 Python 3

pybrdst-0.1-py2-none-any.whl (2.9 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page