diff options
author | Vincent Driessen <vincent@3rdcloud.com> | 2012-02-03 19:14:44 +0100 |
---|---|---|
committer | Vincent Driessen <vincent@3rdcloud.com> | 2012-02-03 19:19:14 +0100 |
commit | 2960eb87b59c93b830e2357ca282aecf4a45f6fe (patch) | |
tree | 862719772068f7aff16bd039cfe068ccbf09e43e | |
parent | a580ddb39f0b999c3db182c4734e262ab1c2e3b6 (diff) | |
download | times-2960eb87b59c93b830e2357ca282aecf4a45f6fe.tar.gz |
No need to explain all the details in the README.
It is enough (and way simpler) for users to only know the to_universal()
call.
-rw-r--r-- | README.md | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -39,12 +39,6 @@ from a user), convert it to universal time immediately: >>> times.to_universal(local_time, 'Europe/Amsterdam') datetime.datetime(2012, 2, 1, 10, 31, 45, 781262) -You can approach the conversion from the other side, too, as `to_universal` is -conveniently aliased to `from_local`: - - >>> times.from_local(local_time, 'Europe/Amsterdam') - datetime.datetime(2012, 2, 1, 10, 31, 45, 781262) - The second argument can be a `pytz.timezone` instance, or a timezone string. If the `local_time` variable already holds timezone info, you _must_ leave out @@ -60,15 +54,12 @@ If you prefer working with UNIX (POSIX) timestamps, you can convert them to safe datetime representations easily: >>> import time, times - >>> print times.from_unix(time.time()) - 2012-02-03 11:58:58.069461 >>> print times.to_universal(time.time()) 2012-02-03 11:59:03.588419 Note that `to_universal` auto-detects that you give it a UNIX timestamp. -To get the correct UTC-based UNIX timestamp representation of a universal -datetime, use: +To get the UNIX timestamp representation of a universal datetime, use: >>> print times.to_unix(universal_time) |