mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 23:00:18 +00:00
d8cbdede28
Signed-off-by: Evan.Mattiza <emattiza@gmail.com>
39 lines
726 B
ReStructuredText
39 lines
726 B
ReStructuredText
.. _quickstart:
|
|
Quickstart
|
|
==========
|
|
|
|
.. module::maya
|
|
|
|
Ready for a simple datetime tool? This doc provides some tools to use in your
|
|
busy workflow.
|
|
|
|
First, make sure that Maya is:
|
|
|
|
- :ref:`Installed <install>`
|
|
- :ref:`Up to date <update>`
|
|
|
|
|
|
Parse a Date
|
|
------------
|
|
Parsing a date from a string with Maya is 🍰!
|
|
|
|
First, you'll need to import maya::
|
|
|
|
>>> import maya
|
|
|
|
There are currently two ways to make sense of datetime:
|
|
|
|
- ``maya.parse``
|
|
- ``maya.when``
|
|
|
|
A simple answer is that you should use parse on machine output, and when on human input.
|
|
|
|
Use as follows::
|
|
|
|
>>> recent_win = maya.parse('2016-11-02T20:00PM')
|
|
>>> old_win = maya.when('October 14, 1908')
|
|
>>> grandpas_date = maya.when('108 years ago')
|
|
|
|
|
|
|