Skip to main content

A library which converts any date into desired date format

Project description

DesiredDateFormat

This module will convert date (the date which python library datetime module provides) into the desired date format. User need to pass 2 arguments, the first argument will be the date and the second one is the desired date format which the user wants to receive output.

user can pass python inbuilt datetime as the first argument for date and the the second argument will be the required format in which the user wants to receive output i.e [dd/mm/yy , mm/dd/yy, yy/mm/dd]

for example:

import datetime

import DesiredDateFormat.Convert as ddt

ddt().convert(datetime.datetime.now(), "dd-mm-yy")

and the output would be same as above

>> output: 23-05-2021 (current date : 2021-05-23)

for example:

convert("2021/05/14","dd/mm/yy")(make sure that the first argument which is 2021/05/14 in the format yy/mm/dd i.e how the python datetime module provides the date)

>> output would be : 14/05/2021

OR

ddt().convert("2021-05-14","dd/mm/yy")

>> output would be : 14/05/2021

OR

Installation

Run the following command to install: pip install DesiredDateFormat

Usage

import DesiredDateFormat.Convert as ddt
import datetime
ddt().convert(datetime.datetime.now(), "dd-mm-yy")
>> output: 23-05-2021 (current date : 2021-05-23) 

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

DesiredDateFormat-1.1.1.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DesiredDateFormat-1.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file DesiredDateFormat-1.1.1.tar.gz.

File metadata

  • Download URL: DesiredDateFormat-1.1.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.3

File hashes

Hashes for DesiredDateFormat-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0c59d42a48eb66360e61023f289bd35f59e4ee2fe2dd918ff8bfe6d76ae5a3de
MD5 0f98c0d731f3e2ea8b2b02fdfcc66572
BLAKE2b-256 f03827ec45235cbebfb73087934052bf5f17d53467700c197fdb717a1cc0af3b

See more details on using hashes here.

File details

Details for the file DesiredDateFormat-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: DesiredDateFormat-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.3

File hashes

Hashes for DesiredDateFormat-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3aff236cc0631864b19b26756fce2d3f4b36b8bd0c999c3a97ed71a20243948a
MD5 41028c780bfd3c4edf1610a0205f4d87
BLAKE2b-256 326c31bbebc68d4052cb772372780db3173bcdd098d330a1089531f56ffe9545

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page