Metadata-Version: 2.1
Name: datetime-parser
Version: 1.0.1
Summary: Parse common datetime formats and a custom relative time format into a Pendulum object.
Home-page: https://github.com/swimlane/datetime-parser
Author: Swimlane
Author-email: info@swimlane.com
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/swimlane/datetime-parser/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pendulum (>=2)

# datetime-parser

datetime can be many different formats and often we want to express a time relative 
to the current time, such as `10 minutes ago`. This module is able to handle all datetime formats
as well as our custom relative time format.

### Relative datetime format:
```
For the current time:
    now
Any other time:
    (+/-)(integer) (milliseconds|seconds|minutes|days|weeks|months|years)
    
examples:
    now
    -1 months
    +3 days
    -123 seconds
```

## Parse Datetime
To parse a datetime (not including relative time), you can use the `try_parse_dt` function. This
will return a pendulum object
```python
from datetime_parser import try_parse_dt

example = "2020-02-02 10:10:10"
example_obj = try_parse_datetime(example)
```

## Parse Relavite Time
To parse a datetime or relative datetime, use `is_datetime`.
```python
from datetime_parser import is_datetime

example = "-5 minutes"
example_obj = is_datetime(example)
```


