DateTimePersian


NameDateTimePersian JSON
Version 1.2.1 PyPI version JSON
download
home_page
SummaryDate Time Persian
upload_time2023-12-09 15:30:51
maintainer
docs_urlNone
authorErfan Mahigir (Sarzamin Danesh Pishro)
requires_python
license
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 |
| 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 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": "",
    "name": "DateTimePersian",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "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/25/92/73f3fe8c6debcbe7701273c9dc96d1fe99005578668b54a8586a32a24790/DateTimePersian-1.2.1.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| 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 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": "",
    "summary": "Date Time Persian",
    "version": "1.2.1",
    "project_urls": null,
    "split_keywords": [
        "python",
        "date",
        "persian",
        "time",
        "gregorian",
        "convert",
        "iranian"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ff248be4f3b5f5a8c2d53ad0e6f16aae6ea7d15a38c51033aeae4e1696655ab",
                "md5": "d2f14ba6ffe2e2b5a8ea8b696c707077",
                "sha256": "8bf1bd6cf15ee34baeca45a824f3c321aefebc17def62b841cbe332ea30e8b6a"
            },
            "downloads": -1,
            "filename": "DateTimePersian-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d2f14ba6ffe2e2b5a8ea8b696c707077",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5613,
            "upload_time": "2023-12-09T15:30:49",
            "upload_time_iso_8601": "2023-12-09T15:30:49.290343Z",
            "url": "https://files.pythonhosted.org/packages/1f/f2/48be4f3b5f5a8c2d53ad0e6f16aae6ea7d15a38c51033aeae4e1696655ab/DateTimePersian-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "259273f3fe8c6debcbe7701273c9dc96d1fe99005578668b54a8586a32a24790",
                "md5": "ca622ca4c89aa2cf901ec1ad94ba2140",
                "sha256": "4a0c8256852d11e9e20cc1c9eb043076b54b840b4c88d5698b235c28ed1dc115"
            },
            "downloads": -1,
            "filename": "DateTimePersian-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ca622ca4c89aa2cf901ec1ad94ba2140",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5740,
            "upload_time": "2023-12-09T15:30:51",
            "upload_time_iso_8601": "2023-12-09T15:30:51.527341Z",
            "url": "https://files.pythonhosted.org/packages/25/92/73f3fe8c6debcbe7701273c9dc96d1fe99005578668b54a8586a32a24790/DateTimePersian-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-09 15:30:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "datetimepersian"
}
        
Elapsed time: 0.14883s