Skip to content

Complete Joda-Time to java.time migration#3039

Open
CydeWeys wants to merge 1 commit intogoogle:masterfrom
CydeWeys:javatime-refactor-10th
Open

Complete Joda-Time to java.time migration#3039
CydeWeys wants to merge 1 commit intogoogle:masterfrom
CydeWeys:javatime-refactor-10th

Conversation

@CydeWeys
Copy link
Copy Markdown
Member

@CydeWeys CydeWeys commented May 9, 2026

This completes the exhaustive refactoring of foundational temporal types from Joda-Time to the native java.time API across the entire codebase.

  • Replaced org.joda.time.DateTime, Instant, LocalDate, and Duration with java.time equivalents.
  • Audited and updated Clock implementations (FakeClock, SystemClock). Added nowMillis() and todayUtc() to eliminate repetitive conversions throughout the codebase.
  • Completely removed all transitional bridge methods from DateTimeUtils and deleted obsolete converters (e.g., DateTimeConverter).
  • Updated testing infrastructure, Apache Beam pipelines, custom JCommander parameters, and networking modules to solely rely on java.time primitives.
  • Retained the lone necessary org.joda.time.Instant usage in SafeBrowsingTransforms required by the Apache Beam API.
  • Cleared Gradle lockfiles and removed the joda-time dependency entirely from the build configuration.

This change is Reviewable

This completes the exhaustive refactoring of foundational temporal types from Joda-Time to the native java.time API across the entire codebase.

- Replaced org.joda.time.DateTime, Instant, LocalDate, and Duration with java.time equivalents.
- Audited and updated Clock implementations (FakeClock, SystemClock). Added nowMillis() and todayUtc() to eliminate repetitive conversions throughout the codebase.
- Completely removed all transitional bridge methods from DateTimeUtils and deleted obsolete converters (e.g., DateTimeConverter).
- Updated testing infrastructure, Apache Beam pipelines, custom JCommander parameters, and networking modules to solely rely on java.time primitives.
- Retained the lone necessary org.joda.time.Instant usage in SafeBrowsingTransforms required by the Apache Beam API.
- Cleared Gradle lockfiles and removed the joda-time dependency entirely from the build configuration.
public DateTime getMtime() {
return new DateTime(Long.parseLong(extractField(136, 12).trim(), 8) * MILLIS_PER_SECOND, UTC);
public Instant getMtime() {
return Instant.ofEpochMilli(Long.parseLong(extractField(136, 12).trim(), 8) * 1000L);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants