Extension to Python `datetime` functionality.
Project description
pyfortified-dateutil
Important Note
Work In Progress
Badges
Install
pip install pyfortified-dateutil
Functions
import pyfortified_dateutil
import datetime as dt
month_first_date, month_last_date = pyfortified_dateutil.dates_month_first_last(dt.date(2016, 12, 20))
print(month_first_date)
print(month_last_date)
datetime.date(2016, 12, 1)
datetime.date(2016, 12, 31)
import pyfortified_dateutil
import datetime as dt
start_dt = dt.date(2015, 12, 20)
end_dt = dt.date(2016, 1, 6)
for dt in pyfortified_dateutil.date_range(start_dt, end_dt):
pprint(dt.strftime("%Y-%m-%d"))
'2015-12-20'
'2015-12-21'
'2015-12-22'
'2015-12-23'
'2015-12-24'
'2015-12-25'
'2015-12-26'
'2015-12-27'
'2015-12-28'
'2015-12-29'
'2015-12-30'
'2015-12-31'
'2016-01-01'
'2016-01-02'
'2016-01-03'
'2016-01-04'
'2016-01-05'
'2016-01-06'
import pyfortified_dateutil
import datetime as dt
start_dt = dt.date(2016, 12, 20)
end_dt = dt.date(2018, 1, 11))
for dt in pyfortified_dateutil.dates_months_list(start_dt, end_dt):
print(dt)
'2016-12'
'2017-01'
'2017-02'
'2017-03'
'2017-04'
'2017-05'
'2017-06'
'2017-07'
'2017-08'
'2017-09'
'2017-10'
'2017-11'
'2017-12'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pyfortified-dateutil-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fda76bd2c2cfd11c709e3e44cf865b48fe712b7427d79223d2188459d7c1222 |
|
MD5 | f3ca5e9301a9a39a2d6bf29bd7c73fb7 |
|
BLAKE2b-256 | b859d3d56aae8c3df2fa55939f8fdbf1ec6fdea1f64b16ff6f4d292167dbabab |
Close
Hashes for pyfortified_dateutil-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ded7a6b741c0ea0b88c9b428e23e2bfb3eb89241f6cefb02b3ce91b03edc4669 |
|
MD5 | d787511a42db7aa7f0d5928a8bbe0fe2 |
|
BLAKE2b-256 | e9634b28e48f76d2392cf53649d2fab1ae05189c8f5203815f217ac95bea42a2 |