Methods
date->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; // 0Related
date->endOfDay(): Set time to final millisecond of the day.date->startOfMonth(): Boundary for month start.
Advertisement
date->diff()
Calculate the chronological difference between two NepaliDate instances in specific time units.
date->endOfDay()
Return a new NepaliDate instance set to the final millisecond of the current day.