Skip to main content

A python package for easy date use and conversions.

Project description

easedate

Description

A python package for easy date use and conversions.

Install

pip install easedate

Currently Available functions


today()

parse(str_date)

str_to_date(str_date, input_format, output_format)

weekday(date, output_format)

add_day(date, value)

add_month(date, value)

add_year(date, value)

diff_in_days(date, base_date)

diff_in_months(date, base_date)

diff_in_years(date, base_date) 

is_after(date, base_date) 

is_before(date, base_date)

is_equal(date, base_date)

Usage example

from easedate.easedate import *


result = str_to_date("22/03/2020", input_format="%d/%m/%Y")

print(result)

# 2020-03-22


result = parse("01/03/2020")

print(result)

# 2020-03-01


result = weekday("22/03/2020")

print(result)

# Sunday


result = weekday("22/03/2020", output_format="%a")

print(result)

# 0 (Sunday is indexed as 0 and Saturday is indexed as 6)


result = add_day("22/03/2020", value=1)

print(result)

# 2020-03-23


result = add_day("22/03/2020", value=-1)

print(result)

# 2020-03-21


result = add_month("22/03/2020", value=1)

print(result)

# 2020-04-23

PyPi

easedate

Author

2020 brworkit.

License

MIT License.

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

easedate-0.0.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

easedate-0.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file easedate-0.0.3.tar.gz.

File metadata

  • Download URL: easedate-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3

File hashes

Hashes for easedate-0.0.3.tar.gz
Algorithm Hash digest
SHA256 25dbc1d681e11593c7429e312c181155be169853d233815b6cfe78fb492ad8cb
MD5 a88f7282cc1c7f3265da42cf44fbc0bb
BLAKE2b-256 9722878f6b9068a057b318f30356e9f719eafe3601cc3c7b88d5fdfc2920f4e9

See more details on using hashes here.

File details

Details for the file easedate-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: easedate-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3

File hashes

Hashes for easedate-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 89988fb02b71ceb26ee22401b9e624cec326ba92fa73cc9e3b529c8748f3f3cc
MD5 1344a0d6900a2b458e29b1aff37a4816
BLAKE2b-256 93f25f41f04b2d5200a3d0f7caf41c7afc1c7483f1152fba442e49977a6f0d1b

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