Skip to content

Instantly share code, notes, and snippets.

@davedavis
Created June 23, 2020 21:06
Show Gist options
  • Save davedavis/9f7eafd1e215c0aee84d10d611e9f434 to your computer and use it in GitHub Desktop.
Save davedavis/9f7eafd1e215c0aee84d10d611e9f434 to your computer and use it in GitHub Desktop.
Fiscal Year and Quarter To Date in Python
>> 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