date

Date handling and formatting in Groovy programs.

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

Groovy Date and Time – Modern API Guide with 12 Tested Examples

Groovy date and time with the java.time API. 12+ examples covering LocalDate, LocalDateTime, ZonedDateTime, Duration, formatting. Groovy 5.x. “The only reason for time is so that everything doesn’t happen at once. In Groovy, at least, you get to control when it does.” Adapted from Albert Einstein Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner to Intermediate | Reading Time: 25 minutes If you’ve ever wrestled with java.util.Date and SimpleDateFormat in Groovy, you know the ... Read More