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)

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.2.1
Filename, size File type Python version Upload date Hashes
Filename, size dilami_calendar-0.2.1.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page