Date-offset
===========
.. image:: https://badge.fury.io/py/date-offset.svg
:target: http://badge.fury.io/py/date-offset
.. image:: https://codecov.io/gh/django-advance-utils/date-offset/branch/main/graph/badge.svg?token=QPGW5TIGX3
:target: https://codecov.io/gh/django-advance-utils/date-offset
This allow you to offset date / time with a string.
Example
.. code-block::
d = DateOffset()
tomorrow = d.get_offset("1d")
yesterday = d.get_offset("-1d")
Keyword
-------
* # start of week (Monday)
* \* end of week
* % first day of the month
* d offset by days (1d)
* w offset by weeks (1w)
* m offset by months (1m)
* y offset by years (1y)
* ~ not weekend
* s offset by seconds (3600s)
* i offset by minutes (60m)
* h offset by hours (1h)
* t time (10t = 10hr. 10:15t = 10hr 15mins. 10:15:45t = 10hr 15mins 45secs)
Usage
-----
If you want to include time in your output the `include_time` must be set.
.. code-block::
d = DateOffset()
one_hours_time = d.get_offset("1h", include_time=True)
Nested string can be used
.. code-block::
d = DateOffset()
second_day_of_current_month = d.get_offset("%1d")
Raw data
{
"_id": null,
"home_page": "https://github.com/django-advance-utils/date-offset",
"name": "date-offset",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Tom Turner",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/a2/ee/39ece7a1a96dfb7f780284c32ec7cff7d3ccc63dee22e68d6335b43bf97d/date-offset-0.0.3.tar.gz",
"platform": null,
"description": "Date-offset\n===========\n.. image:: https://badge.fury.io/py/date-offset.svg\n :target: http://badge.fury.io/py/date-offset\n\n\n.. image:: https://codecov.io/gh/django-advance-utils/date-offset/branch/main/graph/badge.svg?token=QPGW5TIGX3\n :target: https://codecov.io/gh/django-advance-utils/date-offset\n \nThis allow you to offset date / time with a string.\n\nExample\n\n.. code-block::\n\n d = DateOffset()\n tomorrow = d.get_offset(\"1d\")\n yesterday = d.get_offset(\"-1d\")\n\n\n\nKeyword\n-------\n\n* # start of week (Monday)\n* \\* end of week\n* % first day of the month\n* d offset by days (1d)\n* w offset by weeks (1w)\n* m offset by months (1m)\n* y offset by years (1y)\n* ~ not weekend\n* s offset by seconds (3600s)\n* i offset by minutes (60m)\n* h offset by hours (1h)\n* t time (10t = 10hr. 10:15t = 10hr 15mins. 10:15:45t = 10hr 15mins 45secs)\n\n\nUsage\n-----\n\nIf you want to include time in your output the `include_time` must be set.\n\n.. code-block::\n\n d = DateOffset()\n one_hours_time = d.get_offset(\"1h\", include_time=True)\n\n\nNested string can be used\n\n.. code-block::\n\n d = DateOffset()\n second_day_of_current_month = d.get_offset(\"%1d\")\n\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "An library to allow offset of dates by a string",
"version": "0.0.3",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "d710103e676b5f930f98ebcdb64dfed4",
"sha256": "e34743e8d52be5d26faae55b632b848ea0a56f4c68c8281dfc11e03922d48f87"
},
"downloads": -1,
"filename": "date-offset-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "d710103e676b5f930f98ebcdb64dfed4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4868,
"upload_time": "2022-11-01T10:01:52",
"upload_time_iso_8601": "2022-11-01T10:01:52.292667Z",
"url": "https://files.pythonhosted.org/packages/a2/ee/39ece7a1a96dfb7f780284c32ec7cff7d3ccc63dee22e68d6335b43bf97d/date-offset-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-11-01 10:01:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "django-advance-utils",
"github_project": "date-offset",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pytest",
"specs": [
[
"==",
"6.2.5"
]
]
},
{
"name": "coverage",
"specs": [
[
"==",
"6.1.1"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
"==",
"3.0.0"
]
]
}
],
"lcname": "date-offset"
}