Period oneYear = new Period(1, TimeUnit.Years); // create a period of 1 year Period sixMonths = new Period(6, TimeUnit.Months); // create a period of 6 months Period threeDays = new Period(3, TimeUnit.Days); // create a period of 3 days Date startDate = new Date(2021, 1, 1); // create a start date Date endDate = startDate + sixMonths; // add 6 months to the start dateIn these examples, we create Period objects with different time units (years, months, and days). We can then use these periods to specify date ranges, as shown in the last example. The Period class is part of the QLNet library.