Skip to content

Add time comparison methods to ChronosTime#505

Merged
dereuromark merged 1 commit into3.nextfrom
add-time-comparison-methods
Mar 20, 2026
Merged

Add time comparison methods to ChronosTime#505
dereuromark merged 1 commit into3.nextfrom
add-time-comparison-methods

Conversation

@dereuromark
Copy link
Copy Markdown
Member

Summary

Adds four new methods to ChronosTime for checking if a time instance represents common boundary times:

  • isStartOfDay(): Checks if time is 00:00:00.000000
  • isEndOfDay(): Checks if time is 23:59:59 (ignores microseconds)
  • isMidnight(): Alias for isStartOfDay()
  • isMidday(): Checks if time is 12:00:00.000000

Example Usage

$time = ChronosTime::midnight();
$time->isStartOfDay(); // true
$time->isMidnight();   // true

$time = ChronosTime::noon();
$time->isMidday(); // true

$time = ChronosTime::endOfDay();
$time->isEndOfDay(); // true

Add isStartOfDay(), isEndOfDay(), isMidnight(), and isMidday() methods
to ChronosTime for checking if a time instance represents common
boundary times.

- isStartOfDay(): Checks if time is 00:00:00.000000
- isEndOfDay(): Checks if time is 23:59:59 (ignores microseconds)
- isMidnight(): Alias for isStartOfDay()
- isMidday(): Checks if time is 12:00:00.000000
@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
@dereuromark dereuromark merged commit c1a505a into 3.next Mar 20, 2026
8 checks passed
@dereuromark dereuromark deleted the add-time-comparison-methods branch March 20, 2026 11:00
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