Add DateTime.toEpochSeconds and fromEpochSeconds - #6909
Conversation
🦋 Changeset detectedLatest commit: 9300f2a The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
There was a problem hiding this comment.
Important
This PR is missing a changeset for the new public API.
Reviewed changes — 3 files, 2 commits adding DateTime.toEpochSeconds and DateTime.fromEpochSeconds.
toEpochSeconds: Converts anyDateTimeto floored Unix epoch seconds, mirroring the existingtoEpochMillis.fromEpochSeconds: Creates aDateTime.Utcfrom epoch seconds, serving as the inverse oftoEpochSeconds.- Tests: Cover basic conversion, sub-second flooring, and roundtrip.
⚠️ Missing changeset
The PR adds two public API exports (toEpochSeconds and fromEpochSeconds) to the effect package but includes no changeset file. A patch changeset is required for new public API.
Technical details
# Missing changeset
## Affected sites
- `packages/effect/src/DateTime.ts:669` — `fromEpochSeconds` export
- `packages/effect/src/DateTime.ts:1639` — `toEpochSeconds` export
## Required outcome
- Add a `.changeset/` file with `"effect": patch` and a brief description of the added functions.DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — 1 commit adding the changeset requested in the prior review.
- Changeset added:
.changeset/bright-clocks-count.mdwith"effect": patchdescribing the two new exports.
The prior review flagged the missing changeset as the sole concern. Commit 9300f2a addresses it. The code, tests, and internals are unchanged from the prior review and passed that review's scrutiny.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

Closes #6148
Type
Description
Adds epoch seconds utilities to DateTime:
toEpochSeconds(dt)- converts DateTime to Unix epoch seconds (floored)fromEpochSeconds(seconds)- creates DateTime.Utc from epoch secondsMirrors existing
toEpochMillispattern. Includes tests for conversion, flooring, and roundtrip.Previous PRs #6211 and #6470 existed but weren't merged before v3 feature freeze. This targets v4.
Related
Type
Description
Related