Created
December 30, 2013 04:58
-
-
Save studiawan/8177996 to your computer and use it in GitHub Desktop.
XML RPC client for datetime server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://docs.python.org/2/library/xmlrpclib.html | |
import xmlrpclib | |
import datetime | |
proxy = xmlrpclib.ServerProxy("http://localhost:8000/") | |
today = proxy.today() | |
# convert the ISO8601 string to a datetime object | |
converted = datetime.datetime.strptime(today.value, "%Y%m%dT%H:%M:%S") | |
print "Today: %s" % converted.strftime("%d.%m.%Y, %H:%M") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment