Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->getHours()

Retrieve the hour component from zero to twenty three for the current date instance.

The getHours method returns the hour of the day as an integer between 0 and 23 for the current NepaliDate instance. It reflects local time coordinates stored within the instance timestamp.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function getHours(): int;

Parameters

  • None.

Return Value

  • Type: int
  • Range: 0 to 23
  • Description: Hour integer representing time of day.

Example

use NepaliDateLibrary\NepaliDate;

$now = new NepaliDate();
echo "Current hour: " . $now->getHours();

Advertisement

On this page