python-deylami-calendar
Install
pip install deylami-calendar
Usage
Get current datetime in deylami
from deylami_calendar import DeylamiDatetime
print(DeylamiDatetime.now())
Convert Gregorian datetime to Deylami
from datetime import datetime
from deylami_calendar import DeylamiDatetime
gregorian_datetime = datetime(2018, 2, 1)
deylami_datetime = DeylamiDatetime(gregorian_datetime)
Convert Deylami to Gregorian datetime
from deylami_calendar import DeylamiDatetime
deylami_datetime = DeylamiDatetime(1591, 6, 28)
gregorian_datetime = deylami_datetime.to_datetime()
Read attributes
from deylami_calendar import DeylamiDatetime
d = DeylamiDatetime().now()
print(
d.year,
d.month,
d.day,
d.hour,
d.minute,
d.second
)
Set time-zone
import pytz
from deylami_calendar import DeylamiDatetime
d = DeylamiDatetime(tzinfo=pytz.timezone('Asia/Tehran')).now()
print(d)
Credits
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file deylami_calendar-0.1.3.tar.gz.
File metadata
- Download URL: deylami_calendar-0.1.3.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8ed47933de0d31a3335cfbe7d9c248fe10b7d12ffdaeb8fdd2d16e7e466b9c0
|
|
| MD5 |
8b633153b862ea559ce85b177852bba1
|
|
| BLAKE2b-256 |
23ae88e65a785aa3888cb97da46c478580dd5e5d3d8303e0b9b160d050b66170
|