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
Subscribe
Recent Blog Articles
view all
The state of mobile browsers - PPK in London
Thu, 02 Jul 2009
GeoMaker - Turning web content into maps made easy
Wed, 01 Jul 2009
Tue, 30 Jun 2009
Hacking Up North : Winners of the Sunderland Hack Challenge
Fri, 26 Jun 2009
ConvergeSC web event comes to South Carolina
Wed, 24 Jun 2009
Recent Links
Junta42 blog: News Flash: Guardian Seeks to Grow through Products, Not Content
Fri, 03 Jul 2009
Twitter Approval Matrix - June 2009 - O'Reilly Radar
Thu, 02 Jul 2009
YUI 3.0 with Jonathan LeBlanc from the Yahoo Developer Network | Unmatched Style
Wed, 01 Jul 2009
Yahoo! Search Blog: VoCampers Converge at Yahoo! Headquarters in Sunnyvale
Thu, 25 Jun 2009
Make: Online : Dorkbot London June 23
Mon, 22 Jun 2009
Archives
2009
2008
2007
2006
2005

