Working with dates and times - Reduce cursor creation duplication with context managers