dateparser 2.0.3

Library for parsing randomly formated date strings


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

#Date Parser

Build Status Dub Coverage Status

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.

Compiles with D versions 2.068 and up. Tested with ldc v0.17.0 and dmd v2.068.2 - v2.070.2.

##Docs

http://jackstouffer.com/dateparser/

##Install With Dub

{
    ...
    "dependencies": {
        "dateparser": "~>2.0.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)));
    assert(parse("09/25/2003") == SysTime(DateTime(2003, 9, 25)));
    assert(parse("Sep 2003")   == SysTime(DateTime(2003, 9, 1)));
}

Speed

Based on master

String | Python | LDC | DMD ------ | ------ | --- | --- Thu Sep 25 10:36:28 BRST 2003 | 156 µs | 17 μs | 24 μs 2003-09-25T10:49:41.5-03:00 | 136 µs | 7 μs | 12 μs 09.25.2003 | 124 µs | 7 μs | 10 μs 2003-09-25 | 66.4 µs | 5 μs | 7 μs

Authors:
  • Jack Stouffer
Dependencies:
emsi_containers
Versions:
3.0.1 2019-Jan-28
3.0.0 2016-Oct-10
2.1.1 2016-May-31
2.1.0 2016-May-24
2.0.3 2016-May-23
Show all 21 versions
Download Stats:
  • 1 downloads today

  • 10 downloads this week

  • 52 downloads this month

  • 6382 downloads total

Score:
2.0
Short URL:
dateparser.dub.pm