Groovy TimeCategory and Date Manipulation – Cookbook with 10+ Examples
Groovy TimeCategory and date manipulation with 13 tested examples. Write 3.days.ago, 2.hours.from.now, and natural date arithmetic using Groovy’s built-in date DSL and GDK extensions. “There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors in date arithmetic.” Joshua Bloch, Effective Java Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner-Intermediate | Reading Time: 18 minutes Our Groovy Date and Time post covers the java.time API – LocalDate, ZonedDateTime, Duration, ... Read More
