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.

Files for pybrdst, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size pybrdst-0.1-py2-none-any.whl (2.9 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size pybrdst-0.1-py2.py3-none-any.whl (3.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pybrdst-0.1.tar.gz (1.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page