convert date from BS to AD and vice versa
Project description
DateBS
A python library that assists you in converting date from BS to AD and vice versa.
Installation
pip install datebs
usage
Commandline
convert the date 2020-07-01 into BS
python -m datebs BS --date 2020-07-01
using from python
from datebs import DateBS
import argparse
import datetime
if __name__ == "__main__":
parser = argparse.ArgumentParser(prog="python -m datebs",description='Convert date from BS to AD and vice-versa')
parser.add_argument('calendar',type=str, help="calendar system in which date is to be displayed [AD|BS]")
parser.add_argument('--date',type=str, help="date opporsite to the calendar system")
args = parser.parse_args()
if (args.calendar == "BS"):
if args.date:
dateBS = DateBS.from_AD(datetime.datetime.strptime(args.date, "%Y-%m-%d"))
else:
dateBS = DateBS.from_AD(datetime.datetime.now())
print(dateBS)
else:
if args.date:
dateBS = DateBS.from_string(args.date)
print(dateBS.to_AD())
else:
print(datetime.datetime.now())
From LibreOffice calc
Use above formula to convert the date from one string format to another
- DateToBS(datestring)
- DateToAD(datestring)
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
datebs-0.0.6.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file datebs-0.0.6.tar.gz
.
File metadata
- Download URL: datebs-0.0.6.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ade18e603f1078aa7181c4381ed57d305a155d69884b59c60ba9e7eb8fa16ed0 |
|
MD5 | 44ab8b1abe271584328567957a1f2060 |
|
BLAKE2b-256 | 6fd4cab6a0644d727040ef0b5ef8f3d0656330352dd98147a35f211778085482 |
File details
Details for the file datebs-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: datebs-0.0.6-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36439d7e2c58bf7398b5cf27dd3f962d32ffa4ec0af34502e2f903da179acf0d |
|
MD5 | cc7a4067a6e2ffc0187afaa5e2106823 |
|
BLAKE2b-256 | 061e6e3f920f6820a99ff6adc64068840c48b36706c41ffcc81320578cfa4bc3 |