This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients docs@python, rhettinger, vivekvashist
Date 2021-12-31.08:24:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640939099.01.0.293764191482.issue46079@roundup.psfhosted.org>
In-reply-to
Content
This is a little closer to the current code.  Also it has a simpler and more universal url.


from urllib.request import urlopen
url = 'http://worldtimeapi.org/api/timezone/etc/UTC.txt'
with urlopen(url) as request:
    for line in request:
        line = line.decode('utf-8')
        if line.startswith('datetime'):
            print(line)

datetime: 2021-12-31T08:23:15.083004+00:00
History
Date User Action Args
2021-12-31 08:24:59rhettingersetrecipients: + rhettinger, docs@python, vivekvashist
2021-12-31 08:24:59rhettingersetmessageid: <1640939099.01.0.293764191482.issue46079@roundup.psfhosted.org>
2021-12-31 08:24:59rhettingerlinkissue46079 messages
2021-12-31 08:24:58rhettingercreate