Methods
date.is_before()
Check whether the current date occurs chronologically before another specified date.
The is_before method evaluates whether the current NepaliDate instance occurs earlier in time than another provided date. It takes into account both date and time components down to millisecond accuracy.
Import
from nepali_date_library import NepaliDateSignature
def is_before(self, date: NepaliDate) -> bool:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
date | NepaliDate | Yes | Target date to compare against. |
Return Value
- Type:
bool - Description: Returns
Trueifselfis chronologically earlier thandate.
Example
from nepali_date_library import NepaliDate
d1 = NepaliDate("2081-01-01")
d2 = NepaliDate("2081-01-15")
print(d1.is_before(d2)) # True
print(d2.is_before(d1)) # FalseRelated
date.is_after(): Check if later in time.date.is_equal(): Check calendar date equality.
Advertisement
date.end_of_year()
Return a new NepaliDate instance set to the final day of the Bikram Sambat year on the last day of Chaitra.
date.is_after()
Check whether the current date occurs chronologically after another specified date.