Simple cross-platform distributed computing, based on the standards of the Internet.


Mail List







XML-RPC interface for Current Time

Bridging RFC 868 and XML-RPC 

The US National Institute of Standards operates several servers that return the current date-time, expressed in seconds since January 1, 1900. These servers use a protocol defined by RFC 868. It was a simple matter to create a Frontier verb that calls this server and sets the clock.

We call the NIST server on our server once every 24 hours, at midnight Pacific.

The next step was to implement an XML-RPC interface, so that people using tools that support XML-RPC but do not have scriptable access to RFC 868 could get the results of the NIST network.

This server does not account for network latency, there's no fancy code to try to predict how long the response will take to get back to you. Calls can take less than a second over a random Internet path, but as always your mileage may vary. Please report your experience, let's learn more about how this stuff works.

Note: There's also a SOAP 1.1 interface for Current Time.

currentTime.getCurrentTime () returns date/time 

To get the current time, call currentTime.getCurrentTime on time.xmlrpc.com, port 80, path /RPC2.

The call takes no parameters.

It returns the current time as a date/time.

Request and Response 

Here's an example of a call and a response.

User-Agent: Radio UserLand/7.1b7 (WinNT)
Host: time.xmlrpc.com
Content-Type: text/xml
Content-length: 131

<?xml version="1.0"?>

HTTP/1.1 200 OK
Connection: close
Content-Length: 183
Content-Type: text/xml
Date: Wed, 03 Oct 2001 15:53:38 GMT
Server: UserLand Frontier/7.0.1-WinNT

<?xml version="1.0"?>

© Copyright 2004-2011 Scripting News, Inc.
© Copyright 1998-2004 UserLand Software, Inc.
XML-RPC is a trademark of UserLand Software, Inc.
Posted: 10/3/01; 9:09:07 AM Pacific.

Create your own Manila site in minutes. Everyone's doing it!