<?xml version="1.0"?>
<rss version="2.0">
    <channel>
        <title>Gossamer Forum</title>
        <link>http://www.gossamer-threads.com/forum/</link>
        <language>en-us</language>
        <managingEditor>gforum@gossamer-threads.com</managingEditor>
        <pubDate>Fri, 24 May 2013 13:36:33 GMT</pubDate>
        <generator>Gossamer Forum by Gossamer Threads, Inc.</generator>
        <docs>http://www.rssboard.org/rss-specification</docs>
        <image>
            <url>http://static.gossamer-threads.com/forum/images/gforum-logo.png</url>
            <title>Gossamer Forum</title>
            <link>http://www.gossamer-threads.com/forum/</link>
            <width>50</width>
            <height>50</height>
        </image>
        <item>
            <title>Days Ago global</title>
            <link>http://www.gossamer-threads.com/forum/Products_C9/Gossamer_Links_C5/Development%2C_Plugins_and_Globals_F20/Days_Ago_global_P303919/?page=unread#303919</link>
            <description>Hi there ^_^ (!?Where is the old smileys?!)

I have a interresting situation here. Observe the global below...
Now here is the Interresting part. It works very well, whole year round, except for 7 days
of the year...

01-31-2008
03-31-2008
05-31-2008
07-31-2008
08-31-2008
10-31-2008
12-31-2008

I have this feeling it might be something to do with the days being the 31st
of the month.

The tests I ran on the global revealed that on the first eval line:


Code:
$time = &amp;amp;Time::Local::timelocal(0,0,0, $day, $mon, $year);

$time will not change. as if the line is not executed at all.
Is there a specific reason for this... anomaly?



Code:
sub {
my $date = shift;
my ($oyear,$omon,$oday) = split(/-/, $date);
GT::Date::date_set_format(&#039;%yyyy%-%mm%-%dd%&#039;);
my ($year,$mon,$day) = split(/-/,GT::Date::date_get());
$day = int($day); $mon = int($mon); $year = int($year);
$oday = int($oday); $omon = int($omon); $oyear = int($oyear);
require Time::Local;
my $time = 0;
my $otime = 0;

eval {
$time = &amp;amp;Time::Local::timelocal(0,0,0, $day, $mon, $year);
};

eval {
$otime = &amp;amp;Time::Local::timelocal(0,0,0, $oday, $omon, $oyear);
};

my $result = ($time - $otime)/86400;

if($result &amp;gt; 5)
{
return &amp;quot;$result Days ago&amp;quot;;
}
if($result == 0)
{
return &amp;quot;&amp;lt;label style=&#039;color:#F00&#039;&amp;gt;Today&amp;lt;/label&amp;gt;&amp;quot;;
}
if($result == 1)
{
return &amp;quot;&amp;lt;label style=&#039;color:#F00&#039;&amp;gt;Yesterday&amp;lt;/label&amp;gt;&amp;quot;;
}
return &amp;quot;$result Days ago&amp;quot;;
}</description>
            <guid>d41b2c4ca3564f8fbfde707422162adb</guid>
            <pubDate>Oct 31, 2008, 2:40 AM</pubDate>
        </item>
    </channel>
</rss>
