Created
June 23, 2020 21:06
-
-
Save davedavis/9f7eafd1e215c0aee84d10d611e9f434 to your computer and use it in GitHub Desktop.
Fiscal Year and Quarter To Date in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> import fiscalyear | |
>> fiscalyear.setup_fiscal_calendar(start_month=4) | |
>> year = fiscalyear.FiscalYear(2021) | |
>> quarter = fiscalyear.FiscalQuarter.current() | |
>> print(year.start.year) | |
>> print(year.start.month) | |
>> print(year.start.day) | |
>> print(quarter) | |
>> print(type(quarter)) | |
>> print(quarter.start) | |
>> print(quarter.end) | |
2020 | |
4 | |
1 | |
FY2021 Q1 | |
<class 'fiscalyear.FiscalQuarter'> | |
2020-04-01 00:00:00 | |
2020-06-30 23:59:59 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment