<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rfc-duration-class-lygviitcy" -->

---
title: [RFC] Duration class | daily.dev
description: Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6 to represent stopwatch/egg-timer style durations, primarily to improve...
canonical: https://daily.dev/posts/rfc-duration-class-lygviitcy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [RFC] Duration class | daily.dev
og:description: Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6 to represent stopwatch/egg-timer style durations, primarily to improve...
og:url: https://daily.dev/posts/rfc-duration-class-lygviitcy
og:image: https://api.daily.dev/og/posts/LygviiTCy.png
og:image:alt: [RFC] Duration class
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [RFC] Duration class

**[externals.io](https://daily.dev/sources/externals)** · 14 min read · 0 upvotes · 0 comments

## Summary

Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6 to represent stopwatch/egg-timer style durations, primarily to improve developer experience for timeout APIs and the new Polling API. The RFC is intentionally minimal, using a seconds+nanoseconds internal representation (similar to Rust's and Java's Duration). Key design decisions discussed include: limiting the highest constructor unit to hours, omitting ISO 8601 serialization and floating-point total methods for now to avoid precision/rounding complexity, using the `Time` namespace (aligned with Rust's `std::time`, Java's `java.time`, and Go's `time`), and rejecting the use of the `temporal_rs` Rust library as it would add a complex dependency without meaningful benefit. Community feedback raised questions about adding `getTotalSeconds()`, ISO 8601 round-trip support, namespace choice (`DateTime` vs `Time`), and whether to replace `add`/`sub` methods with a single variadic `sum` method.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131401>

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-h255ra0w8) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-jaakxgyjc) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-web8nsdzs) · externals.io · 1 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-i7kxexek8) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-guidld0hx) · externals.io · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/rfc-duration-class-lygviitcy)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"[RFC] Duration class","url":"https://daily.dev/posts/rfc-duration-class-lygviitcy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rfc-duration-class-lygviitcy"},"datePublished":"2026-06-19T10:41:38.943Z","dateModified":"2026-06-19T10:42:00.842Z","description":"Tim Düsterhus and Derick Rethans have proposed a new `Time\\Duration` class for PHP 8.6 to represent stopwatch/egg-timer style durations, primarily to improve...","image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","thumbnailUrl":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","isAccessibleForFree":true,"articleSection":"externals.io","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"externals.io","logo":"https://media.daily.dev/image/upload/s--9i0zxASK--/f_auto,q_auto/v1780213616/logos/externals?_a=BAMAMiWQ0","url":"https://daily.dev/sources/externals"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rfc-duration-class-lygviitcy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,php","timeRequired":"PT14M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"externals.io","item":"https://daily.dev/sources/externals"},{"@type":"ListItem","position":3,"name":"[RFC] Duration class"}]}
```

