Skip to content

Add time comparison methods to ChronosTime#505

Open
dereuromark wants to merge 1 commit into3.nextfrom
add-time-comparison-methods
Open

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

Conversation

@dereuromark
Copy link
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
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.

1 participant