Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.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

import { NepaliDate } from "nepali-date-library";

Signature

getHours(): number;

Parameters

  • None.

Return Value

  • Type: number
  • Range: 0 to 23

Example

import { NepaliDate } from "nepali-date-library";

const date = new NepaliDate();
console.log(date.getHours()); // e.g. 14

Advertisement

On this page