Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.endOfDay()

Return a new NepaliDate instance set to the final millisecond of the current day.

The endOfDay method returns a new NepaliDate instance with time coordinates set to the final moment of the day at 23 hours, 59 minutes, 59 seconds, and 999 milliseconds. This is commonly used when setting upper boundaries for database queries, event schedules, and daily audit filters.


Import

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

Signature

endOfDay(): NepaliDate;

Parameters

This method does not take any parameters.


Return Value

  • Type: NepaliDate
  • Returns a new cloned NepaliDate instance set to 23:59:59.999 on the same calendar day. The original instance is not modified.

Examples

Generating End-of-Day Timestamp

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

const date = new NepaliDate("2081-05-15");
const end = date.endOfDay();

console.log(end.getHours()); // 23
console.log(end.getMinutes()); // 59
console.log(end.getSeconds()); // 59
console.log(end.getMilliseconds()); // 999

Inclusive Day Range Filtering

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

// Set upper bound for date filters
const reportDate = new NepaliDate("2081-01-31").endOfDay();

console.log(reportDate.getTime()); // Unix timestamp in milliseconds

Advertisement

On this page