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.

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

# date/datetime formatting with Nepali month unicode support
>>> nepali_datetime.date(2078, 1, 10).strftime('%N') # वैशाख

# BS calendar
>>> nepali_datetime.date.today().calendar()

           Kartik 2077            
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

# ... and many more

*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.

Installation

$ pip install nepali-datetime

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.4.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

nepali_datetime-1.0.4-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file nepali-datetime-1.0.4.tar.gz.

File metadata

  • Download URL: nepali-datetime-1.0.4.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.5.10

File hashes

Hashes for nepali-datetime-1.0.4.tar.gz
Algorithm Hash digest
SHA256 19ff21b094a2ce38ed46f18b33093d63621aafa0568ab2e52f2e2b1db0b97dbe
MD5 ebe440e4bbb7a48d5613ac09629ca74a
BLAKE2b-256 35d0d97be7ee6b978b09f95562f274c6304a0c1a32563ff5ec0cf06d65896e02

See more details on using hashes here.

File details

Details for the file nepali_datetime-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: nepali_datetime-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.5.10

File hashes

Hashes for nepali_datetime-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3b75351f19f2f222b425f16e5e1800765f173bb391ed3c2da3ee70875b355964
MD5 5af4a7c31368ef2f4347db0e06649d31
BLAKE2b-256 58ec06b39a956e972e096102337d1e9b84803a45344053c4a4f24d9cbebcd558

See more details on using hashes here.

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