to support the new time parser and search functions in YaCy a high
precision detection of date and time on the day is necessary. That
requires that the time zone of the document content and the time zone of
the user, doing a search, is detected. The time zone of the search
request is done automatically using the browsers time zone offset which
is delivered to the search request automatically and invisible to the
user. The time zone for the content of web pages cannot be detected
automatically and must be an attribute of crawl starts. The advanced
crawl start now provides an input field to set the time zone in minutes
as an offset number. All parsers must get a time zone offset passed, so
this required the change of the parser java api. A lot of other changes
had been made which corrects the wrong handling of dates in YaCy which
was to add a correction based on the time zone of the server. Now no
correction is added and all dates in YaCy are UTC/GMT time zone, a
normalized time zone for all peers.
cal.add(Calendar.MINUTE,timezoneOffset);// add a correction; i.e. for UTC+1 -60 minutes is added to patch a time given in UTC+1 to the actual time at UTC
//if (d == null) try {d = GenericFormatter.FORMAT_SHORT_DAY.parse(text);} catch (ParseException e) {} // did not work well and fired for wrong formats; do not use
//if (d == null) try {d = GenericFormatter.FORMAT_SHORT_DAY.parse(text);} catch (ParseException e) {} // did not work well and fired for wrong formats; do not use
@ -797,7 +797,7 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
try{
try{
finalGenericFormattermy_SHORT_SECOND_FORMATTER=
finalGenericFormattermy_SHORT_SECOND_FORMATTER=
newGenericFormatter(GenericFormatter.FORMAT_SHORT_SECOND,GenericFormatter.time_second);// use our own formatter to prevent concurrency locks with other processes
newGenericFormatter(GenericFormatter.FORMAT_SHORT_SECOND,GenericFormatter.time_second);// use our own formatter to prevent concurrency locks with other processes
// getTime creates a UTC time number. But in this case java thinks, that the given
// getTime creates a UTC time number. But in this case java thinks, that the given
// time string is a local time, which has a local UTC offset applied.
// time string is a local time, which has a local UTC offset applied.
// Therefore java subtracts the local UTC offset, to get a UTC number.
// Therefore java subtracts the local UTC offset, to get a UTC number.
@ -831,7 +831,7 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
try{
try{
finalGenericFormattermy_SHORT_SECOND_FORMATTER=
finalGenericFormattermy_SHORT_SECOND_FORMATTER=
newGenericFormatter(GenericFormatter.FORMAT_SHORT_SECOND,GenericFormatter.time_second);// use our own formatter to prevent concurrency locks with other processes
newGenericFormatter(GenericFormatter.FORMAT_SHORT_SECOND,GenericFormatter.time_second);// use our own formatter to prevent concurrency locks with other processes