Skip to main content

A Python package for formatting strings into readable date strings

Project description

date_time_format

a Python package that formats a ten character string to a date

Installation

pip install date_formatter

Usage

Minimal example

from date_formatter import *

date_time_string_US = "12-18-2014"
date_time_string_AUS = "18-12-2014"

myDates_US = DateFormatter.dateFormat(date_time_string_US, False, True, "US")
myDates_AUS = DateFormatter.dateFormat(date_time_string_AUS, True, False)

print(myDates_US)
print(myDates_AUS)

returns:

  • 18-Dec-14
  • 18 December 2014

Parameters

  • date_time_string: str The date string you want to format
  • USE_FULL_MONTH_NAME : bool Whether to display the full name of the month. If this is set to True, shows "January"; if this is set to False, shows "Jan".
  • USE_HYPHEN_AS_SPACER : bool Whether to show interval between characters as single space, or hyphen. If this is set to True, shows "18-Jan-14"; if this set to False, shows "18 Jan 14"
  • REGION_FORMAT : str, optional Which region's date format to use. If set to "US" assumes string is "MM-DD-YYYY"; if this is set to something or is missing, assumes string is "DD-MM-YYYY"

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

date_formatter-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

date_formatter-0.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file date_formatter-0.1.1.tar.gz.

File metadata

  • Download URL: date_formatter-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.6.10 Windows/10

File hashes

Hashes for date_formatter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1e7c33bef5edbf0709aa3b4a26b9300c4c1d220f6d039fd7284343012e4e5a07
MD5 befe63e0e41b939e08030666efd6229a
BLAKE2b-256 2a8da9dc55393ea7c8eb85fa3c4b20b285fd106f619ce262e753b058d1fcaee0

See more details on using hashes here.

File details

Details for the file date_formatter-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: date_formatter-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.6.10 Windows/10

File hashes

Hashes for date_formatter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4477e129170a132a9b95f234ca1f1185f0db40e64eac7cd6f446ff26babfd2f3
MD5 b72cd3ed5722126abedb8ddfc575b94a
BLAKE2b-256 beacba94b50ba91eed8d3dd44a46795c10284450ef6daceac9a5f5eaa73d1ad7

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