Skip to content

Add startOfHour() and endOfHour() methods to ChronosTime#508

Merged
dereuromark merged 1 commit into3.nextfrom
add-time-boundary-methods
Mar 15, 2026
Merged

Add startOfHour() and endOfHour() methods to ChronosTime#508
dereuromark merged 1 commit into3.nextfrom
add-time-boundary-methods

Conversation

@dereuromark
Copy link
Member

Summary

Adds boundary methods to ChronosTime for resetting to hour boundaries:

  • startOfHour(): Resets to the start of the current hour (X:00:00.000000)
  • endOfHour(): Sets to the end of the current hour (X:59:59.999999)

Example Usage

$time = ChronosTime::parse('12:30:45.123456');

$time->startOfHour()->format('H:i:s.u'); // '12:00:00.000000'
$time->endOfHour()->format('H:i:s.u');   // '12:59:59.999999'

Adds boundary methods to ChronosTime for resetting to hour boundaries:

- startOfHour(): Resets to the start of the current hour (X:00:00.000000)
- endOfHour(): Sets to the end of the current hour (X:59:59.999999)
@dereuromark dereuromark added this to the 3.next milestone Mar 14, 2026
@dereuromark dereuromark marked this pull request as ready for review March 14, 2026 18:45
Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.

@dereuromark dereuromark merged commit f50c542 into 3.next Mar 15, 2026
8 checks passed
@dereuromark dereuromark deleted the add-time-boundary-methods branch March 15, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants