Skip to main content

Jalali datetime binding for python

Project description

jdatetime is Jalali implementation of Python’s datetime module

Status

https://travis-ci.org/slashmili/python-jalali.svg?branch=master https://img.shields.io/pypi/v/jdatetime.svg https://img.shields.io/pypi/dm/jdatetime.svg

Install

pip install jdatetime

Documents

This module exactly follows Python Standard datetime module’s methods http://docs.python.org/release/2.7.1/library/datetime.html

Also these methods are addedd to jdatetime.date and jdatetime.datetime :

|  fromgregorian(**kw)
|      Convert gregorian to jalali and return jdatetime.date
|      jdatetime.date.fromgregorian(day=X,month=X,year=X)
|      jdatetime.date.fromgregorian(date=datetime.date)
|      jdatetime.date.fromgregorian(datetime=datetime.datetime)
|  togregorian(self)
|      Convert current jalali date to gregorian and return datetime.date
|  isleap(self)
|      check if year is leap year
|      algortim is based on http://en.wikipedia.org/wiki/Leap_year

Example

$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import jdatetime
>>> jdatetime.datetime.now()
jdatetime.datetime(1394, 12, 4, 8, 37, 31, 855729)
>>> jdatetime.date.today()
jdatetime.date(1394, 12, 4)

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

jdatetime-1.7.4.tar.gz (9.0 kB view details)

Uploaded Source

File details

Details for the file jdatetime-1.7.4.tar.gz.

File metadata

  • Download URL: jdatetime-1.7.4.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jdatetime-1.7.4.tar.gz
Algorithm Hash digest
SHA256 79b83d247eb224c6fd882262feb66002d94ab4f462110990884fb0d31c851ccc
MD5 24e7fb2a1a3a6aecfcd5e774b51d9915
BLAKE2b-256 955716bed22cfb59ea8d673a4d79c092a45117d5d4383934a9614caf43fe8f0a

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