Creating a special class for managing time intervals