diff --git a/htroot/Network.html b/htroot/Network.html
index 95011abe1..9f8f4aa8c 100644
--- a/htroot/Network.html
+++ b/htroot/Network.html
@@ -43,6 +43,7 @@
#(complete)#::
Address |
Hash |
+Age |
#(/complete)#
Type |
Release/ SVN |
@@ -71,6 +72,7 @@
::
http://#[ip]#:#[port]# |
#[hash]# |
+#[age]# |
#(/complete)#
#(type)#junior::senior::principal#(/type)# |
#[version]# |
diff --git a/htroot/Network.java b/htroot/Network.java
index e8fa4b2c7..f2888ae0d 100644
--- a/htroot/Network.java
+++ b/htroot/Network.java
@@ -293,8 +293,6 @@ public class Network {
links = Long.parseLong(seed.get("LCount", "0"));
words = Long.parseLong(seed.get("ICount", "0"));
} catch (Exception exc) {links = 0; words = 0;}
- prop.put(STR_TABLE_LIST+conCount+"_complete", ((complete)? 1 : 0) );
- prop.put(STR_TABLE_LIST+conCount+"_hash", seed.hash);
String shortname = seed.get("Name", "deadlink");
if (shortname.length() > 20) {
shortname = shortname.substring(0, 20) + "...";
@@ -306,6 +304,7 @@ public class Network {
prop.put(STR_TABLE_LIST+conCount+"_complete_ip", seed.get("IP", "-") );
prop.put(STR_TABLE_LIST+conCount+"_complete_port", seed.get("Port", "-") );
prop.put(STR_TABLE_LIST+conCount+"_complete_hash", seed.hash);
+ prop.put(STR_TABLE_LIST+conCount+"_complete_age", seed.getAge());
}else{
prop.put(STR_TABLE_LIST+conCount+"_complete", 0);
}
diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java
index 0412836a6..d202f4e67 100644
--- a/source/de/anomic/yacy/yacySeed.java
+++ b/source/de/anomic/yacy/yacySeed.java
@@ -245,6 +245,18 @@ public class yacySeed {
}
}
+ public int getAge() {
+ // returns the age as number of days
+ try {
+ long t = yacyCore.shortFormatter.parse(get("BDate", "20040101000000")).getTime();
+ return (int) ((System.currentTimeMillis() - (t - getUTCDiff() + serverDate.UTCDiff())) / 1000 / 60 / 60 / 24);
+ } catch (java.text.ParseException e) {
+ return -1;
+ } catch (java.lang.NumberFormatException e) {
+ return -1;
+ }
+ }
+
public void setLastSeenTime() {
// if we set a last seen time, then we need to respect the seeds UTC offset
put("LastSeen", yacyCore.shortFormatter.format(new Date(System.currentTimeMillis() - serverDate.UTCDiff() + getUTCDiff())));