Skip to content

Instantly share code, notes, and snippets.

@studiawan
Created December 30, 2013 04:58
Show Gist options
  • Save studiawan/8177996 to your computer and use it in GitHub Desktop.
Save studiawan/8177996 to your computer and use it in GitHub Desktop.
XML RPC client for datetime server
# 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