Yahoo! Developer Network Blog
« Previous | Main | Next »
September 26, 2006
getTime - Our First Utility Web Service
getTime is a handy service for building AJAX applications and learning how to work with XML and web services. When called, getTime returns the current time on the Yahoo! server, in your choice of XML, serialized PHP, or JSON.
The first application using getTime is the countdown timer on hackday.org. We're using the serialized PHP result, unserialze it and pull the value out of the array.
$timeUrl = "http://developer.yahooapis.com/TimeService/V1/getTime?appid=YahooHackDay&output=php"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $timeUrl ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $result = curl_exec($ch); $result = unserialize($result); $timestamp = $result['Result']['Timestamp'];
Yes, this may be overkill ... :)
Dan Theurer
Posted at September 26, 2006 9:15 AM | Permalink
Subscribe
Recent Blog Articles
view all
YQL Open Table for Google Buzz now live
Tue, 09 Feb 2010
INSERT INTO twitter.status ...
Mon, 08 Feb 2010
Announcing the Yahoo! Brasil Open Hack Day 2010, 20-21 March
Mon, 08 Feb 2010
Marketing hacks, linchpins, and tech women of valor
Sun, 07 Feb 2010
Yahoo! India invites you to join the first India Hadoop Summit
Thu, 04 Feb 2010
Recent Links
Appcelerator Titanium + Yahoo YQL on Vimeo
Mon, 08 Feb 2010
Tue, 02 Feb 2010
PhoneGap | Cross platform mobile framework
Sat, 30 Jan 2010
Web developers can rule the iPad - O'Reilly Radar
Sat, 30 Jan 2010
rc3.org - Is the iPad the harbinger of doom for personal computing?
Thu, 28 Jan 2010
Archives
2010
2009
2008
2007
2006
2005
Recent Readers

