Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.is_equal()

Check whether two date instances share the exact same calendar date coordinates regardless of time.

The is_equal method checks whether the current NepaliDate instance shares the exact same Bikram Sambat year, month, and day coordinates as another date object, ignoring any differences in hours, minutes, seconds, or milliseconds.


Import

from nepali_date_library import NepaliDate

Signature

def is_equal(self, date: NepaliDate) -> bool:

Parameters

ParameterTypeRequiredDescription
dateNepaliDateYesDate instance to compare coordinates with.

Return Value

  • Type: bool
  • Description: Returns True if year, month, and day are identical.

Example

from nepali_date_library import NepaliDate

d1 = NepaliDate("2081-07-15")
d2 = NepaliDate("2081-07-15")

print(d1.is_equal(d2)) # True

Advertisement

On this page