Skip to content

Commit

Permalink
Tweak a paragraph in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-rhodes committed Dec 17, 2015
1 parent 2a51d60 commit 026225f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ephem/doc/date.rst
Expand Up @@ -129,10 +129,12 @@ Datetime objects
is why PyEphem exposes its own date type
instead of returning Python ``datetime`` objects automatically.

Note that python ``datetime`` objects use local time by default.
PyEphem expects UTC ``datetime`` objects. ``datetime.now()`` will
give unexpected results. Use ``datetime.utcnow()`` instead:

Note that Python ``datetime`` objects use your local time by default,
whereas PyEphem expects time to be expressed in UTC.
This means that passing ``datetime.now()`` to PyEphem
will give unexpected results.
Instead, use the ``datetime.utcnow()`` constructor:

>>> d = datetime.datetime.utcnow()
>>> ephem.Date(d)
2015/12/14 15:42:14
Expand Down

0 comments on commit 026225f

Please sign in to comment.