Nepali DateNepali DateBikram Sambat Date Engine
Methods

date.parse()

Parse a formatted Bikram Sambat date string and update the current date instance in place.

The parse method parses a Bikram Sambat date string and updates the coordinates of the current NepaliDate instance in place. It supports various delimiter styles including slashes, dots, and hyphens, recalculating the underlying timestamp upon successful parsing.


Import

from nepali_date_library import NepaliDate

Signature

def parse(self, date_string: str) -> None:

Parameters

ParameterTypeRequiredDescription
date_stringstrYesFormatted Bikram Sambat date string (e.g. "2081-07-15").

Return Value

  • Type: None
  • Note: Mutates the current instance in place.

Example

from nepali_date_library import NepaliDate

date = NepaliDate()
date.parse("2081-07-15")
print(date.format("YYYY-MM-DD")) # "2081-07-15"

Advertisement

On this page