dateparser 0.3.0

Library for parsing randomly formated date strings


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

#Date Parser

Build Status Dub Coverage Status

Docs

A port of the Python Dateutil date parser. This module offers a generic date/time string parser which is able to parse most known formats to represent a date and/or time. This module attempts to be forgiving with regards to unlikely input formats, returning a SysTime object even for dates which are ambiguous.

As this follows SemVer, this is currently beta quality software. Expect the API to break many times until this hits 1.0.

Compiles with D versions 2.068 and up. Tested with ldc v0.17.0 and dmd v2.068.2 - v2.070.2. In order to use this with LDC and DMD 2.068, you must download and compile this manually due to a limitation in the dub.json format.

##Install With Dub

{
    ...
    "dependencies": {
        "dateparser": "~>0.1.0"
    }
}

Simple Example

View the docs for more.

import std.datetime;
import dateparser;

void main()
{
    assert(parse("2003-09-25") == SysTime(DateTime(2003, 9, 25)));
}

Speed

StringPythonLDCDMD
Thu Sep 25 10:36:28 BRST 2003156 µs15 μs and 7 hnsecs25 μs
2003-09-25T10:49:41.5-03:00136 µs13 μs and 3 hnsecs21 μs and 2 hnsecs
09.25.2003124 µs41 μs and 1 hnsec32 μs and 9 hnsecs
2003-09-2566.4 µs8 μs and 2 hnsecs12 μs and 3 hnsecs

To Do

In order of importance:

  • ✓ Pass all tests
  • make interface more idiomatic D, which includes
  • range-ify interface
  • ✓ remove as many GC allocations as possible
  • ✓ get at least 6x faster than the Python version

I will consider this library to be at 1.0.0 when the first three happen.

Authors:
  • Jack Stouffer
Dependencies:
containers
Versions:
3.0.4 2021-Aug-04
3.0.3 2020-Oct-02
3.0.2 2020-Aug-31
3.0.1 2019-Jan-28
3.0.0 2016-Oct-10
Show all 25 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 27 downloads this month

  • 140698 downloads total

Score:
1.9
Short URL:
dateparser.dub.pm