Source code for date
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Calculate spacial dates.
:Date: 2018-01-15
.. module:: date
:platform: *nix, Windows
:synopsis: Special dates.
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
"""
[docs]def easter_sunday(year):
"""Easter Sunday.
:param year: the year to calculate the Easter Sunday
:type year: int
:returns: the day of Easter Sunday
:rtype: datetime.date"""
import datetime
march = datetime.date(year, 3, 1)
day = march + datetime.timedelta(days=gaußsche_osterformel(year))
return day
[docs]def easter_friday(year):
"""Easter Friday.
:param year: the year to calculate the Easter Friday
:type year: int
:returns: the day of Easter Friday
:rtype: datetime.date"""
import datetime
day = easter_sunday(year) + datetime.timedelta(days=-2)
return day
[docs]def easter_monday(year):
"""Easter Monday.
:param year: the year to calculate the Easter Monday
:type year: int
:returns: the day of Easter Monday
:rtype: datetime.date"""
import datetime
day = easter_sunday(year) + datetime.timedelta(days=+1)
return day
[docs]def ascension_of_jesus(year):
"""Ascension of Jesus.
:param year: the year to calculate the ascension of Jesus
:type year: int
:returns: the day of ascension of Jesus
:rtype: datetime.date"""
import datetime
day = easter_sunday(year) + datetime.timedelta(days=+39)
return day
[docs]def pentecost(year):
"""Pentecost.
:param year: the year to calculate the Pentecost
:type year: int
:returns: the day of Pentecost
:rtype: datetime.date"""
import datetime
day = easter_sunday(year) + datetime.timedelta(days=+49)
return day