Skip to main content

Package for converting string timestamps into datetimes.

Project description

dateparse

Build Status
Coverage Status
PyPI version

Dateparser for creating datetime objects from arbitrarily formated date strings. Primary support for Norwegian date formats.

New version is a complete refactor:

  • Much faster parsing.
  • Reduced pattern complexity.
  • Improved matching rutine.
  • Some reduced functionality with less used time formats (centuries, relative dates, text based).

Install

pip install dateparse-tobiasli

Usage

import datetime
from dateparse import DateParser
parser = DateParser()

# Dates with alpha components:
dt = parser.parse('5. januar 2015')
print(dt == [datetime.datetime(2015, 1, 5, 0, 0)])

# Multiple dates from same string:
dt = parser.parse('1/12/2014 kl 12, 11.12.2015 kl 14')
print(dt == [datetime.datetime(2014, 12, 1, 12, 00), datetime.datetime(2015, 12, 11, 14, 00)])

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

dateparse-tobiasli-1.1.1.tar.gz (3.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page