Skip to main content

datetime module that operates on bikram sambat & nepal time

Project description

Nepali Datetime (Bikram Sambat B.S & Nepal Time NPT)

The package similar to Python's core datetime package that operates on Bikram Sambat (B.S) date & Nepal Time +05:45.

Installation

$ pip install nepali-datetime

Usage

The Python3 core datetime library usage VS nepali_datetime usage.

# importing the module
>>> import datetime
>>> import nepali_datetime

# getting today's date
>>> datetime.date.today()
>>> nepali_datetime.date.today()

# getting now datetime
>>> datetime.datetime.now()
>>> nepali_datetime.datetime.now()

# creating date object
>>> datetime.date(2020, 9, 4)
>>> nepali_datetime.date(2077, 5, 19)

# creating datetime object
>>> datetime.datetime(2020, 9, 4, 8, 26, 10, 123456)
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456)

# date/datetime formatting
>>> datetime.datetime(2020, 9, 4, 8, 26, 10, 123456).strftime("%d %B %Y") # 04 September 2020
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456).strftime("%d %B %Y") # 19 Bhadau 2077 

*Note: The equivalence is not limited to just getting current datetime. Its supports most of the methods from Python's core datetime library. Check documentation for more details.

Documentation

Complete documentations can be found here.

Contribution

For contribution check the guidelines in CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nepali-datetime-1.0.3.tar.gz (14.6 kB view hashes)

Uploaded Source

Built Distribution

nepali_datetime-1.0.3-py3-none-any.whl (15.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page