diff options
author | Stuart Bishop <stuart.bishop@canonical.com> | 2018-10-24 16:04:35 +0700 |
---|---|---|
committer | Stuart Bishop <stuart.bishop@canonical.com> | 2018-10-24 16:04:35 +0700 |
commit | c9df7ae6222875f943245c14782873c0863fd99c (patch) | |
tree | bef1d68288a6c04a10372b50d1e999eb739bbdb5 | |
parent | 566ad8ae76418cf6b797a2906c446a9c1382a706 (diff) | |
download | pytz-git-c9df7ae6222875f943245c14782873c0863fd99c.tar.gz |
Add warnings to examples showing what not to dorelease_2018.6
-rw-r--r-- | src/README.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/README.txt b/src/README.txt index a865c27..d9b0390 100644 --- a/src/README.txt +++ b/src/README.txt @@ -87,13 +87,13 @@ localized time using the standard ``astimezone()`` method: Unfortunately using the tzinfo argument of the standard datetime constructors ''does not work'' with pytz for many timezones. ->>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt) +>>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt) # /!\ Does not work this way! '2002-10-27 12:00:00 LMT+0020' It is safe for timezones without daylight saving transitions though, such as UTC: ->>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt) +>>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt) # /!\ Not recommended except for UTC '2002-10-27 12:00:00 UTC+0000' The preferred way of dealing with times is to always work in UTC, |