Skip to main content

Dilami (Gilaki) calendar for python

Project description

python-dilami-calendar

Build Status PyPI PyPI - Python Version GitHub license

Install

pip install dilami-calendar

Usage

Get current datetime in Dilami

from dilami_calendar import DilamiDatetime

print(DilamiDatetime.now())

Convert Gregorian datetime to Dilami

from datetime import datetime
from dilami_calendar import DilamiDatetime

gregorian_datetime = datetime(2018, 2, 1)
dilami_datetime = DilamiDatetime(gregorian_datetime)

Convert Dilami to Gregorian datetime

from dilami_calendar import DilamiDatetime

dilami_datetime = DilamiDatetime(1591, 6, 28)
gregorian_datetime = dilami_datetime.to_datetime()

Read attributes

from dilami_calendar import DilamiDatetime

d = DilamiDatetime().now()
print(
    d.year,
    d.month,
    d.day,
    d.hour,
    d.minute,
    d.second
)

Set time-zone

import pytz
from dilami_calendar import DilamiDatetime

d = DilamiDatetime(tzinfo=pytz.timezone('Asia/Tehran')).now()
print(d)

Maybe You Like

PHP Dilami Calendar
C++ Dilami Calendar
Arduino Dilami Calendar
.Net Dilami Calendar
تقویم دیلمی

Credits

Project details


Download files

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

Files for dilami-calendar, version 0.4.3
Filename, size File type Python version Upload date Hashes
Filename, size dilami_calendar-0.4.3.tar.gz (9.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page