Utility Web Services: getTime

This service has been deprecated. If you have any concerns or questions, please don't hesitate to contact us in General Discussion at YDN forum.

Requesting the Yahoo! Server Time.

The getTime service lets you request the current time on the Yahoo! servers. It is a very basic web service that is really handy for building AJAX applications or learning how to work with XML and web services.

Important: getTime is not intended to replace services like NTP. Due to the nature of HTTP requests and our server architecture, getTime will never be exact or definitive for any area except the server it's running on.

Request URL

http://developer.yahooapis.com/TimeService/V1/getTime

Request Parameters

See information on constructing REST queries

Parameter Value Description
appid string (required) The application ID. See Application IDs for more information.
format string: (optional) default "unix" Defines the timestamp format for the call. Accepted values are "unix" to get a unix timestamp and "ms" to get the time in milliseconds.
output string: (optional) default "xml" Defines the output for the call. Accepted values are "xml", "json" and "php"
callback string: (optional) default "" The callback parameter has no effect unless output=json
is used. If set, it wraps the JSON object in call to the selected function.

Sample Request Url: http://developer.yahooapis.com/TimeService/V1/getTime?appid=YahooDemo

Response Fields

The schema document for this service response is located at http://developer.yahooapis.com/TimeService/V1/GetTimeResponse.xsd

Field Description
Result Contains the response.
Timestamp The current Yahoo! Server Time is returned in the format specified in the format parameter, as described above. The servers are set to PDT (Pacific Daylight Time) which is UTC-7

Sample Response

The following is a sample response for a getTime request :

Errors

The getTime service returns the standard errors. There are no service-specific errors.

Ready to get started?

By applying for an Application ID for this service, you hereby agree to the Terms of Use