Skip to content

Commit

Permalink
* fix timezone problem
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6518 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
f1ori committed Dec 6, 2009
1 parent 713cb26 commit 8c8b642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/de/anomic/yacy/yacyPeerActions.java
Expand Up @@ -97,7 +97,7 @@ public synchronized boolean connectPeer(final yacySeed seed, final boolean direc
}

// connection time
final long nowUTC0Time = System.currentTimeMillis(); // is better to have this value in a variable for debugging
final long nowUTC0Time = DateFormatter.correctedUTCTime(); // is better to have this value in a variable for debugging
long ctimeUTC0 = seed.getLastSeenUTC();

if (ctimeUTC0 > nowUTC0Time) {
Expand Down
6 changes: 3 additions & 3 deletions source/de/anomic/yacy/yacySeed.java
Expand Up @@ -213,7 +213,7 @@ public yacySeed(final String theHash) {
this.dna.put(yacySeed.IPTYPE, "∅");

// settings that can only be computed by visiting peer
this.dna.put(yacySeed.LASTSEEN, DateFormatter.formatShortSecond(new Date(System.currentTimeMillis() - DateFormatter.UTCDiff()))); // for last-seen date
this.dna.put(yacySeed.LASTSEEN, DateFormatter.formatShortSecond(new Date(DateFormatter.correctedUTCTime()))); // for last-seen date
this.dna.put(yacySeed.USPEED, yacySeed.ZERO); // the computated uplink speed of the peer

this.dna.put(yacySeed.CRWCNT, yacySeed.ZERO);
Expand Down Expand Up @@ -518,7 +518,7 @@ public final void setLastSeenUTC() {
// because java thinks it must apply the UTC offset to the current time,
// to create a string that looks like our current time, it adds the local UTC offset to the
// time. To create a corrected UTC Date string, we first subtract the local UTC offset.
dna.put(yacySeed.LASTSEEN, DateFormatter.formatShortSecond(new Date(System.currentTimeMillis() - DateFormatter.UTCDiff())) );
dna.put(yacySeed.LASTSEEN, DateFormatter.formatShortSecond(new Date(DateFormatter.correctedUTCTime())) );
}

/**
Expand Down Expand Up @@ -738,7 +738,7 @@ public static yacySeed genLocalSeed(final yacySeedDB db, final int port, final S
// now calculate other information about the host
newSeed.dna.put(yacySeed.NAME, (name) == null ? "anonymous" : name);
newSeed.dna.put(yacySeed.PORT, Integer.toString((port <= 0) ? 8080 : port));
newSeed.dna.put(yacySeed.BDATE, DateFormatter.formatShortSecond(new Date(System.currentTimeMillis() - DateFormatter.UTCDiff())) );
newSeed.dna.put(yacySeed.BDATE, DateFormatter.formatShortSecond(new Date(DateFormatter.correctedUTCTime())) );
newSeed.dna.put(yacySeed.LASTSEEN, newSeed.dna.get(yacySeed.BDATE)); // just as initial setting
newSeed.dna.put(yacySeed.UTC, DateFormatter.UTCDiffString());
newSeed.dna.put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN);
Expand Down

0 comments on commit 8c8b642

Please sign in to comment.