DateTimePersian


NameDateTimePersian JSON
Version 1.3.0 PyPI version JSON
download
home_pageNone
SummaryDate Time Persian
upload_time2024-07-27 20:15:38
maintainerNone
docs_urlNone
authorErfan Mahigir (Sarzamin Danesh Pishro)
requires_pythonNone
licenseNone
keywords python date persian time gregorian convert iranian
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
## Date Time Persian

This library helps you to convert the Gregorian date to Iranian date and the Iranian date to Gregorian date.  
You can also get the current time along with the date.

This library is supported by [Sarzemin Danesh](https://lssc.ir) team.

You can contact us by sending an email or following our official page on Instagram:

Email : [info@Lssc.ir](mailto:info@Lssc.ir)

Instagram : [@sarzamin.danesh](https://instagram.com/sarzamin.danesh)

---

## How it works?

Use the following command to install this library

```python
pip install DateTimePersian
```

## Use :

**Display the current date and time.**  
The output is a string.

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date)

_________ output _________
1401/9/5  15:09:48
```

**Only show the current date.**  
The output is a string.

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian(TIME=False)
print(get_date)

_________ output _________
1401/9/5
```

**Only show the current time.**  
The output is a string.

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian(DATE=False)
print(get_date)

_________ output _________
15:09:48
```

**Command today() :**

The desired function displays the current date in numeric and text formats. Two settings named date and type are defined for it.

Date = “fa” / “en”

Type = int / str

**Ex : Default**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.today())

_________ output _________
1401/9/5
```

**Ex : Type = str**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.today(Type = str))

_________ output _________
1401 آذر 5
```

**Ex : Date = “en”**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.today(Date = "en"))

_________ output _________
2022/11/26
```

**Ex: Date = “en” and Type = str**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.today(Date = "en", Type = str))

_________ output _________
2022 Nov 26
```

**Other commands:**

| value | command | type | output |
| --- | --- | --- | --- |
| Year Persian | getYearP() | object | int |
| Year Gregorian | getYearE() | object | int |
| Month Persian | getMonthP() | object | int |
| Month Gregorian | getMonthE() | object | int |
| Day Persian | getDayP() | object | int |
| Day Gregorian | getDayE() | object | int |
| Hour | getHour() | object | str |
| Minutes | getMin() | object | str |
| Seconds | getSec() | object | str |
| leap year | lYear(year) | static | int |
| leap check | is_leap(year) | object | bool |
| name day Persian | getNameDayP() | object | str |
| name day Gregorian | getNameDayE(type = 'L' / 'S') | object | str |
| name month Persian | getNameMonthP() | object | str |
| name month Gregorian | getNameMonthE(type = 'en' / 'fa') | object | str |

**Example Leap Year :**

```python
from DateTimePersian import DateTimePersian

print(DateTimePersian.today(1401))

_________ output _________
350
```

**Example Leap Check :**

```python
from DateTimePersian import DateTimePersian
date = DateTimePersian()
print(date.is_leap(1403))

_________ output _________
True
```

**Example name day Persian :**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.getNameDayP())

_________ output _________
جمعه
```

**Example name day Gregorian with type = 'L' :**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.getNameDayE())

_________ output _________
Friday
```

**Example name day Gregorian with type = 'S' :**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.getNameDayE(type = 'S'))

_________ output _________
Fri
```

**Example name month Persian :**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.getNameMonthP())

_________ output _________
مرداد
```

**Example name month Gregorian with type = 'en' :**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.getNameMonthE())

_________ output _________
Aug
```

**Example name month Gregorian with type = 'fa' :**

```python
from DateTimePersian import DateTimePersian
get_date = DateTimePersian()
print(get_date.getNameMonthE(type = 'fa'))

_________ output _________
اوت
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "DateTimePersian",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, Date, Persian, Time, Gregorian, Convert, Iranian",
    "author": "Erfan Mahigir (Sarzamin Danesh Pishro)",
    "author_email": "<info@Lssc.ir>",
    "download_url": "https://files.pythonhosted.org/packages/ee/0e/ff9eb00f64381879abe47f439306b86db05a08dab9983fc66b00c39fe59f/datetimepersian-1.3.0.tar.gz",
    "platform": null,
    "description": "\r\n## Date Time Persian\r\n\r\nThis library helps you to convert the Gregorian date to Iranian date and the Iranian date to Gregorian date.  \r\nYou can also get the current time along with the date.\r\n\r\nThis library is supported by [Sarzemin Danesh](https://lssc.ir) team.\r\n\r\nYou can contact us by sending an email or following our official page on Instagram:\r\n\r\nEmail : [info@Lssc.ir](mailto:info@Lssc.ir)\r\n\r\nInstagram : [@sarzamin.danesh](https://instagram.com/sarzamin.danesh)\r\n\r\n---\r\n\r\n## How it works?\r\n\r\nUse the following command to install this library\r\n\r\n```python\r\npip install DateTimePersian\r\n```\r\n\r\n## Use :\r\n\r\n**Display the current date and time.**  \r\nThe output is a string.\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date)\r\n\r\n_________ output _________\r\n1401/9/5  15:09:48\r\n```\r\n\r\n**Only show the current date.**  \r\nThe output is a string.\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian(TIME=False)\r\nprint(get_date)\r\n\r\n_________ output _________\r\n1401/9/5\r\n```\r\n\r\n**Only show the current time.**  \r\nThe output is a string.\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian(DATE=False)\r\nprint(get_date)\r\n\r\n_________ output _________\r\n15:09:48\r\n```\r\n\r\n**Command today() :**\r\n\r\nThe desired function displays the current date in numeric and text formats. Two settings named date and type are defined for it.\r\n\r\nDate = \u201cfa\u201d / \u201cen\u201d\r\n\r\nType = int / str\r\n\r\n**Ex : Default**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.today())\r\n\r\n_________ output _________\r\n1401/9/5\r\n```\r\n\r\n**Ex : Type = str**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.today(Type = str))\r\n\r\n_________ output _________\r\n1401 \u0622\u0630\u0631 5\r\n```\r\n\r\n**Ex : Date = \u201cen\u201d**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.today(Date = \"en\"))\r\n\r\n_________ output _________\r\n2022/11/26\r\n```\r\n\r\n**Ex: Date = \u201cen\u201d and Type = str**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.today(Date = \"en\", Type = str))\r\n\r\n_________ output _________\r\n2022 Nov 26\r\n```\r\n\r\n**Other commands:**\r\n\r\n| value | command | type | output |\r\n| --- | --- | --- | --- |\r\n| Year Persian | getYearP() | object | int |\r\n| Year Gregorian | getYearE() | object | int |\r\n| Month Persian | getMonthP() | object | int |\r\n| Month Gregorian | getMonthE() | object | int |\r\n| Day Persian | getDayP() | object | int |\r\n| Day Gregorian | getDayE() | object | int |\r\n| Hour | getHour() | object | str |\r\n| Minutes | getMin() | object | str |\r\n| Seconds | getSec() | object | str |\r\n| leap year | lYear(year) | static | int |\r\n| leap check | is_leap(year) | object | bool |\r\n| name day Persian | getNameDayP() | object | str |\r\n| name day Gregorian | getNameDayE(type = 'L' / 'S') | object | str |\r\n| name month Persian | getNameMonthP() | object | str |\r\n| name month Gregorian | getNameMonthE(type = 'en' / 'fa') | object | str |\r\n\r\n**Example Leap Year :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\n\r\nprint(DateTimePersian.today(1401))\r\n\r\n_________ output _________\r\n350\r\n```\r\n\r\n**Example Leap Check :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\ndate = DateTimePersian()\r\nprint(date.is_leap(1403))\r\n\r\n_________ output _________\r\nTrue\r\n```\r\n\r\n**Example name day Persian :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.getNameDayP())\r\n\r\n_________ output _________\r\n\u062c\u0645\u0639\u0647\r\n```\r\n\r\n**Example name day Gregorian with type = 'L' :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.getNameDayE())\r\n\r\n_________ output _________\r\nFriday\r\n```\r\n\r\n**Example name day Gregorian with type = 'S' :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.getNameDayE(type = 'S'))\r\n\r\n_________ output _________\r\nFri\r\n```\r\n\r\n**Example name month Persian :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.getNameMonthP())\r\n\r\n_________ output _________\r\n\u0645\u0631\u062f\u0627\u062f\r\n```\r\n\r\n**Example name month Gregorian with type = 'en' :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.getNameMonthE())\r\n\r\n_________ output _________\r\nAug\r\n```\r\n\r\n**Example name month Gregorian with type = 'fa' :**\r\n\r\n```python\r\nfrom DateTimePersian import DateTimePersian\r\nget_date = DateTimePersian()\r\nprint(get_date.getNameMonthE(type = 'fa'))\r\n\r\n_________ output _________\r\n\u0627\u0648\u062a\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Date Time Persian",
    "version": "1.3.0",
    "project_urls": null,
    "split_keywords": [
        "python",
        " date",
        " persian",
        " time",
        " gregorian",
        " convert",
        " iranian"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3813a75bca7e470d76a721a0c5ae687e0eb901ecc20fe7f1a6f75ea4f0b18c3",
                "md5": "ab55ff8a0f31d2b07eb33f6e84331d41",
                "sha256": "68d1167eafd7ea75b09403806dafb334b3db358c94ec5c00f95a27b4a7e44a51"
            },
            "downloads": -1,
            "filename": "DateTimePersian-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab55ff8a0f31d2b07eb33f6e84331d41",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5799,
            "upload_time": "2024-07-27T20:15:21",
            "upload_time_iso_8601": "2024-07-27T20:15:21.322508Z",
            "url": "https://files.pythonhosted.org/packages/e3/81/3a75bca7e470d76a721a0c5ae687e0eb901ecc20fe7f1a6f75ea4f0b18c3/DateTimePersian-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee0eff9eb00f64381879abe47f439306b86db05a08dab9983fc66b00c39fe59f",
                "md5": "418688fa3b534ecef0aabdf8ef46cf5f",
                "sha256": "9d796b2afb08fc31f6d99d3701776b4d167facb06938911fdd9e3ab9484ded42"
            },
            "downloads": -1,
            "filename": "datetimepersian-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "418688fa3b534ecef0aabdf8ef46cf5f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5964,
            "upload_time": "2024-07-27T20:15:38",
            "upload_time_iso_8601": "2024-07-27T20:15:38.255313Z",
            "url": "https://files.pythonhosted.org/packages/ee/0e/ff9eb00f64381879abe47f439306b86db05a08dab9983fc66b00c39fe59f/datetimepersian-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-27 20:15:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "datetimepersian"
}
        
Elapsed time: 0.46371s