<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1019110" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1019110</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/days#comment-1113282</link>
    <description> &lt;p&gt;date is 1 field... in the form of &lt;strong&gt;date(&quot;m\/j\/Y&quot;)&lt;/strong&gt;&lt;br /&gt;
I could make it 3 fields... but that would totally complicate things&lt;/p&gt;
 </description>
     <pubDate>Sat, 31 Aug 2002 15:39:34 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1113282 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/days#comment-1113266</link>
    <description> &lt;p&gt;Even easier to through the whole thing at the SQL server...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// assuming one &#039;date&#039; field&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT (TO_DAYS(SYSDATE()) - TO_DAYS(date)) as age FROM dates\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;echo mysql_error();&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;age&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;echo \&quot;Age is &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// not tested&lt;br /&gt;// assuming &#039;day&#039;, &#039;month&#039;, &#039;year&#039; fields&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;SELECT (TO_DAYS(SYSDATE()) - TO_DAYS(CONCAT(year,&#039;-&#039;,month,&#039;-&#039;,day))) as age FROM dates\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;echo mysql_error();&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;age&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;echo \&quot;Age is &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 31 Aug 2002 07:56:38 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1113266 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/days#comment-1113258</link>
    <description> &lt;p&gt;Oh ya know what... that works perfectly with a bit of tweeking&lt;br /&gt;
(Just in case someone wants a working version)&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$query &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM dates WHERE (date) LIKE (&#039;1&#039;) \&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;echo mysql_error();&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$day&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;day&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;; &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;month&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;year&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;br /&gt;//remember you need bday as day month year &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bdayunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mktime (\&quot;\&quot;,\&quot;\&quot;,\&quot;\&quot;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$day&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); //get unix ts for bday &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$nowunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = time(); //get unix ts for today &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ageunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$nowunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; - &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bdayunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;; //work out the difference &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = floor(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ageunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; / (24 * 60 * 60)); //convert from seconds to years &lt;br /&gt;&lt;br /&gt;echo \&quot;Age is &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;; &lt;br /&gt; &lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
Of course, it&#039;d be different values for $row[] but you get the point... that shows up as 242 days... the number of days from January 1st 2002&lt;br /&gt;
Thanks a billion busy&lt;/p&gt;
 </description>
     <pubDate>Sat, 31 Aug 2002 05:10:32 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1113258 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/days#comment-1113257</link>
    <description> &lt;p&gt;&lt;strong&gt;mktime()&lt;/strong&gt; is my latest probability... I had just seen that on php.net when I got this reply...&lt;br /&gt;
I&#039;ll try it out, but if anyone else has better suggestions, I&#039;d love to hear them&lt;br /&gt;
Thanks&lt;/p&gt;
 </description>
     <pubDate>Sat, 31 Aug 2002 04:55:28 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1113257 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/days#comment-1113254</link>
    <description> &lt;p&gt;here&#039;s a script out of &quot;PHP and MYSQL development&quot; book I found&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//set date for calculation&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$day &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;18&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;9&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1972&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//remember you need bday as day month year&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bdayunix &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mktime &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\&quot;,\&quot;\&quot;,\&quot;\&quot;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$day&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); //get unix ts for bday&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$nowunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = time(); //get unix ts for today&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ageunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$nowunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; - &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$bdayunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;; //work out the difference&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = floor(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ageunix&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; / (365 * 24 * 60 * 60)); //convert from seconds to years&lt;br /&gt;&lt;br /&gt;echo \&quot;Age is &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$age&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;this is for a birthday script to find out how old the person is. Could be easily changed for your needs, I believe&lt;br /&gt;
further info on calendar dates at&lt;br /&gt;
date and time&lt;br /&gt;
&lt;a href=&quot;http://php.net/manual/ref.datetime.php&quot; class=&quot;bb-url&quot;&gt;http://php.net/manual/ref.datetime.php&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://mysql.com/documentation/mysql/commented/manual.php?section=Date_and_time_functions&quot; class=&quot;bb-url&quot;&gt;http://mysql.com/documentation/mysql/commented/manual.php?section=Date_and_time_functions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;calendar functions&lt;br /&gt;
&lt;a href=&quot;http://php.net/manual/ref.calendar.php&quot; class=&quot;bb-url&quot;&gt;http://php.net/manual/ref.calendar.php&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 31 Aug 2002 04:47:36 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1113254 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/days#comment-1113247</link>
    <description> &lt;p&gt;What do you mean??? How could it count it?&lt;br /&gt;
I am running cron programs with this, I could set it up to add 1 day to a table column &#039;daysince&#039; but that would take a lot of modifying, and I&#039;d prefer to keep it as I have it, if possible&lt;/p&gt;
 </description>
     <pubDate>Sat, 31 Aug 2002 03:57:39 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1113247 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/days#comment-1113246</link>
    <description> &lt;p&gt;how about doing it by the hour (or min) then converting that back to days&lt;/p&gt;
 </description>
     <pubDate>Sat, 31 Aug 2002 03:55:30 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1113246 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
