Nepali Datetime (Bikram Sambat Date & Nepal Time)
The package inspired from Python's core datetime
package that
operates on top of Bikram Sambat (B.S) Date & Nepal Time (NPT) +05:45
.
Supports: Python 3.5+
Basic Usage
>>> import datetime
>>> import nepali_datetime
>>> datetime.date.today()
>>> nepali_datetime.date.today()
>>> datetime.datetime.now()
>>> nepali_datetime.datetime.now()
>>> datetime.date(2020, 9, 4)
>>> nepali_datetime.date(2077, 5, 19)
>>> datetime.datetime(2020, 9, 4, 8, 26, 10, 123456)
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456)
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456).strftime("%d %B %Y")
>>> nepali_datetime.datetime.strptime('2077-09-12', '%Y-%m-%d')
>>> nepali_datetime.date(1977, 10, 25).strftime('%K-%n-%D (%k %N %G)')
>>> nepali_datetime.date(1990, 5, 10) + datetime.timedelta(days=350)
>>> nepali_datetime.datetime(1990, 5, 10, 5, 10, 20) + datetime.timedelta(hours=3, minutes=15)
>>> nepali_datetime.date(1999, 7, 25).to_datetime_date()
>>> nepali_datetime.date.from_datetime_date(datetime.date(1942, 11, 10))
>>> nepali_datetime.date(2078, 1, 1).calendar()
Baishakh 2078
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Installation
$ pip install nepali-datetime
Documentation
Complete usage documentations can be found here.
Contribution
Any contributions are most welcome. Do check this guidelines CONTRIBUTING.md for code contribution.