# java.time.chrono

***

**1. Getting the current chronology:**

```java
ChronoLocalDate now = ChronoLocalDate.now();
```

**2. Creating a date from a string:**

```java
ChronoLocalDate date = ChronoLocalDate.parse("2023-03-08");
```

**3. Getting the chronology of a date:**

```java
Chronology chrono = date.getChronology();
```

**4. Converting a date to another chronology:**

```java
ChronoLocalDate otherDate = date.withChronology(ChronoLocalDate.of(2023, 3, 8).getChronology());
```

**5. Getting the calendar system of a chronology:**

```java
CalendarSystem calendarSystem = chrono.getCalendarSystem();
```

**6. Getting the era of a date:**

```java
Era era = date.getEra();
```

**7. Getting the year of a date:**

```java
int year = date.getYear();
```

**8. Getting the month of a date:**

```java
Month month = date.getMonth();
```

**9. Getting the day of the month of a date:**

```java
int dayOfMonth = date.getDayOfMonth();
```

**10. Getting the day of the week of a date:**

```java
DayOfWeek dayOfWeek = date.getDayOfWeek();
```

**11. Getting the day of the year of a date:**

```java
int dayOfYear = date.getDayOfYear();
```

**12. Getting the week of the year of a date:**

```java
int weekOfYear = date.getWeekOfWeekyear();
```

**13. Getting the month value of a date:**

```java
int monthValue = date.getMonthValue();
```

**14. Getting the year value of a date:**

```java
int yearValue = date.getYearValue();
```

**15. Getting the epoch day of a date:**

```java
long epochDay = date.toEpochDay();
```

**16. Converting an epoch day to a date:**

```java
ChronoLocalDate date = ChronoLocalDate.ofEpochDay(epochDay);
```

**17. Getting the start of the month of a date:**

```java
ChronoLocalDate startOfMonth = date.withDayOfMonth(1);
```

**18. Getting the end of the month of a date:**

```java
ChronoLocalDate endOfMonth = date.withDayOfMonth(date.lengthOfMonth());
```

**19. Getting the start of the year of a date:**

```java
ChronoLocalDate startOfYear = date.withMonth(1).withDayOfMonth(1);
```

**20. Getting the end of the year of a date:**

```java
ChronoLocalDate endOfYear = date.withMonth(12).withDayOfMonth(31);
```

**21. Adding days to a date:**

```java
ChronoLocalDate newDate = date.plusDays(10);
```

**22. Subtracting days from a date:**

```java
ChronoLocalDate newDate = date.minusDays(10);
```

**23. Adding months to a date:**

```java
ChronoLocalDate newDate = date.plusMonths(3);
```

**24. Subtracting months from a date:**

```java
ChronoLocalDate newDate = date.minusMonths(3);
```

**25. Adding years to a date:**

```java
ChronoLocalDate newDate = date.plusYears(2);
```

**26. Subtracting years from a date:**

```java
ChronoLocalDate newDate = date.minusYears(2);
```

**27. Comparing two dates:**

```java
int comparison = date1.compareTo(date2);
```

**28. Checking if a date is before another date:**

```java
boolean isBefore = date1.isBefore(date2);
```

**29. Checking if a date is after another date:**

```java
boolean isAfter = date1.isAfter(date2);
```

**30. Checking if a date is equal to another date:**

```java
boolean isEqual = date1.equals(date2);
```

**31. Creating a date from a chronology, year, month, and day of month:**

```java
ChronoLocalDate date = ChronoLocalDate.of(chrono, 2023, 3, 8);
```

\*\*32. Creating a date from a chron
