Skip to content

ph datetime

Philip Helger edited this page Apr 8, 2026 · 3 revisions

Extension library for Java date and time handling with formatting, parsing, display and XML conversion utilities.

Highlights:

  • PDTFactory - create date/time objects conveniently
  • PDTFormatter / PDTFromString / PDTToString - formatting and parsing with pattern support
  • PDTDisplayHelper - user-friendly date/time display (e.g. "2 hours ago")
  • PDTWebDateHelper - web-specific date/time handling (RFC 822, XSD, etc.)
  • PDTXMLConverter - XML conversion for date/time types
  • DateTimeFormatterCache - cached DateTimeFormatter instances
  • OffsetDate / XMLOffsetDate / XMLOffsetDateTime - timezone-aware date/time types
  • LocalDatePeriod / LocalDateTimePeriod - date range handling
  • Expirable / ExpiringObject - objects with expiration tracking

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger.commons</groupId>
  <artifactId>ph-datetime</artifactId>
  <version>x.y.z</version>
</dependency>

Note: the Maven groupId changed in v10 from com.helger to com.helger.commons

Clone this wiki locally