Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->startOfDay()

Return a new NepaliDate instance set to the first moment of the current day at midnight.

The startOfDay method returns a new NepaliDate instance with time coordinates set to midnight at 00 hours, 00 minutes, 00 seconds, and 000 milliseconds. This is useful for date normalization and time neutral comparisons.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function startOfDay(): self;

Parameters

  • None.

Return Value

  • Type: NepaliDate
  • Description: New date instance set to 00:00:00.000 UTC.

Example

use NepaliDateLibrary\NepaliDate;

$date = new NepaliDate();
$midnight = $date->startOfDay();
echo $midnight->getHours() . PHP_EOL;   // 0
echo $midnight->getMinutes() . PHP_EOL; // 0

Advertisement

On this page