// public function getGeckoDate()
// returns the Gecko date for Gecko-based browsers, null for others
//
+ // public function getGeckoTime()
+ // returns the Gecko build date/time as a unix epoch time number for Gecko-based browsers, null for others
+ //
// *** functions for compat to older versions of this class ***
//
// public function isns()
return $this->uadata['geckodate'];
}
+ public function getGeckoTime() {
+ if (!isset($this->uadata['geckotime'])) {
+ $this->uadata['geckotime'] = null;
+ if (!is_null($this->getGeckoDate())) {
+ $use_time = (strlen($this->getGeckoDate()) > 8);
+ $gd_str = substr($this->getGeckoDate(),0,4).'-'.substr($this->getGeckoDate(),4,2).'-'.substr($this->getGeckoDate(),6,2);
+ if ($use_time) {
+ $gd_str .= substr($this->getGeckoDate(),8,2).':00';
+ $old_tz = date_default_timezone_get();
+ date_default_timezone_set("America/Los_Angeles");
+ }
+ $this->uadata['geckotime'] = strtotime($gd_str);
+ if ($use_time) { date_default_timezone_set($old_tz); }
+ }
+ }
+ return $this->uadata['geckotime'];
+ }
+
public function isBot() { return $this->bot; }
public function isns() {
print("<br>The operating system is reported as "<b>".$ua->getOS()."</b>"\n");
print("<br>The system platform is reported as "<b>".$ua->getPlatform()."</b>"\n");
print("<br>The browser language is reported as "<b>".$ua->getLanguage()."</b>"\n");
-if ($ua->hasEngine('gecko')) { print("<br>The Gecko date is reported as "<b>".$ua->getGeckoDate()."</b>"\n"); }
+if ($ua->hasEngine('gecko')) {
+ print("<br>The Gecko date is reported as "<b>".$ua->getGeckoDate()."</b>"\n");
+ print("<br>The full Gecko date/time is reported as "<b>".date('r',$ua->getGeckoTime())."</b>"\n");
+}
print("<br><br>I conclude this must be <b>".$ua->getBrand()." ".$ua->getVersion()."</b>\n");
print("<br>This is <b>".($ua->isBot()?"an":"no")."</b> automated robot.\n");