In GetRssRcLinke? function, "dc:date" of rss output is made by the code,
$date = sprintf("%4d-%02d-%02dT%02d:%02d:%02d+%02d:00", $year, $mon+1, $mday, $hour, $min, $sec, $TimeZoneOffset/(60*60));
However, it is correct only if "Server's clock" is set to GMT.
For example, the server in which my homepage is located in Korea. It's clock is set to +9:00. So every guests (all of them are Korean) of my homepage set their TimeZoneOffset in Preferences to zero . If a page is modified on 10:00 of server clock (= 1:00 GMT), then rss output is:
<dc:date>2003-10-03T10:00:00+00:00</dc:date>
Therefore, a rss aggregator program such as "Feed Demon" mistakes the page was modified on "10:00 GMT", adds +9 due to the locale of my PC, and says "the page is modified on 19:00"
To fix this problem, I added a new config variable, "RssTimeZone? = 9", which means the timezone of server clock. And changed the code to
$date = sprintf("%4d-%02d-%02dT%02d:%02d:%02d+%02d:00", $year, $mon+1, $mday, $hour, $min, $sec, ($TimeZoneOffset/(60*60) + $RssTimeZone));
I can't guess whether this change make a new problem (I don't know about rss). Any advice will be appreciated.
my $gmt_offset = $TimeZoneOffset/(60*60) + $RssTimeZone; my $plusminus = $gmt_offset > 0 ? '+' : '-'; $date = sprintf("%4d-%02d-%02dT%02d:%02d:%02d%d%02d:00", $year, $mon+1, $mday, $hour, $min, $sec, $plusminus, abs($gmt_offset) );
Also.. for daylight savings time, it's a pain to have to manually change the time zone offset parameter twice a year (not to mention figuring out which way it needs to be adjusted!) Perhaps there's a way to get the time info from the system?
-- Anonymous
I think the above submission tries to print '+' or '-' with the printf character specifier %d; how about this:
my $gmt_offset = $TimeZoneOffset/(60*60) + $RssTimeZone; my $plusminus = $gmt_offset > 0 ? '+' : '-'; $date = sprintf("%4d-%02d-%02dT%02d:%02d:%02d%s%02d:00", $year, $mon+1, $mday, $hour, $min, $sec, $plusminus, abs($gmt_offset) );
-- BayleShanks
--- aktivikio.pl 2007-03-08 17:06:04.000000000 +0100 +++ aktivikio-provo-2007-03-13.pl 2007-03-13 13:53:27.000000000 +0100 @@ -996,11 +996,10 @@ } $status = (1 == $revision) ? 'new' : 'updated'; $importance = $isEdit ? 'minor' : 'major'; - $timestamp += $TimeZoneOffset; - my ($sec, $min, $hour, $mday, $mon, $year) = localtime($timestamp); + my ($sec, $min, $hour, $mday, $mon, $year) = gmtime($timestamp); $year += 1900; $date = sprintf("%4d-%02d-%02dT%02d:%02d:%02d+%02d:00", - $year, $mon+1, $mday, $hour, $min, $sec, $TimeZoneOffset/(60*60)); + $year, $mon+1, $mday, $hour, $min, $sec, 0 ); $pagename = &QuoteHtml?($pagename); # Write it out longhand $item = <<RSS ;
-- Paul Ebermann