Created
June 14, 2011 11:01
-
-
Save feedhenry-gists/1024687 to your computer and use it in GitHub Desktop.
Current Date/Time Cache Return Time Date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCurrentTimeRegEx() { | |
var response = $fh.web({ | |
url: 'http://www.timeanddate.com/worldclock/city.html?n=78', | |
method: 'GET' | |
}); | |
// Construct a regular expression to extract the date and time from the response | |
var reg = /(<strong id=ct[^>]*>)([^<]*)/; | |
//Extract the required info | |
var dateMatch = reg.exec(response.body); | |
return {'date': dateMatch[2]}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment