<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Calcolo anno tra 2 date]]></title><description><![CDATA[<p dir="auto">Salve a tutti,</p>
<p dir="auto">ho un codice adattato preso da un altro post in cui mi ha fornito la soluzione <strong>altraSoluzione e Ultima</strong>,<br />
quelloche vorrei ottenere e' il tempo trascorso in anni tra la datia iniziale e oggi<br />
esempio:</p>
<p dir="auto">Start: 2010   ------------&gt; <em><strong>campo(start                     year(4)</strong></em><br />
today: 2019</p>
<p dir="auto">9 anni in totale</p>
<p dir="auto">ecco il codice, ma non funziona, mi restituisce errore</p>
<p dir="auto"><strong>Catchable fatal error</strong>:  Object of class DateInterval could not be converted to string in <strong>W:\domains\localhost\Cinema\cinema.php</strong> on line <strong>323</strong></p>
<p dir="auto"><strong>line 323 e' questa</strong></p>
<pre><code class="language-php">&lt;?php echo $diff; ?&gt;
</code></pre>
<pre><code class="language-php">&lt;?php // code calcolo eta' by altraSoluzione by Ultima from forum GT

$start = $row['start'];

$dateOfStart = $start;
$today = date("Y-m-d");
$diff = date_diff(date_create($dateOfStart), date_create($today));
 
?&gt;
</code></pre>
<pre><code class="language-php">&lt;?php echo $diff; ?&gt;
</code></pre>
<p dir="auto">grazie</p>
]]></description><link>https://dev.connect.gt/topic/238623/calcolo-anno-tra-2-date</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 23:00:32 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/238623.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Sep 2019 07:40:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Fri, 13 Sep 2019 06:01:03 GMT]]></title><description><![CDATA[<p dir="auto">risolto <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /><br />
questo funziona benissimo</p>
<pre><code class="language-php">&lt;?php    
$start = $row['start'];
$end = !empty($row['end']) ? $row['end'] : date('Y');
$diff = $end - $start;
echo '&lt;font color="blue"&gt;'. $diff . ' Year' . ($diff &gt; 1 ? 's' : '') . '&amp;nbsp' . In . '&amp;nbsp' . The . '&amp;nbsp' . Business . '&lt;/font&gt;'; 
?&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1259198</link><guid isPermaLink="true">https://dev.connect.gt/post/1259198</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Fri, 13 Sep 2019 06:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Tue, 10 Sep 2019 09:27:39 GMT]]></title><description><![CDATA[<p dir="auto">questo codice va bene se sono compilati i campi <strong>start</strong> ed <strong>end</strong>, ma nel mio database ci sono moltissimi record (il 90%)  in cui e' presente solo <strong>start</strong> (integrato con l'anno attuale, <strong>today</strong>)</p>
]]></description><link>https://dev.connect.gt/post/1259213</link><guid isPermaLink="true">https://dev.connect.gt/post/1259213</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Tue, 10 Sep 2019 09:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Tue, 10 Sep 2019 08:44:55 GMT]]></title><description><![CDATA[<p dir="auto">hai scritto</p>
<blockquote>
<p dir="auto"><strong>riepilogo campi:</strong></p>
<p dir="auto"><strong>start</strong> --------------&gt; year(4)</p>
<p dir="auto"><strong>end</strong> --------------&gt; year(4)</p>
<p dir="auto">qui un esempio, dovrebbe calcolarmi 48 anni e non 51</p>
</blockquote>
<p dir="auto">Qui implica che hai un inizio e una fine carriera.</p>
<p dir="auto">poi</p>
<blockquote>
<p dir="auto">bisogna integrare il codice sopra (con today, anni, anno, start)</p>
</blockquote>
<p dir="auto">se metti today (oggi) è inevitabile che ti conteggia tutto<br />
è logico start/end</p>
<pre><code>[COLOR=#cc7832][B]&lt;?php
[/B][/COLOR][COLOR=#9876aa]$row [/COLOR]= date([COLOR=#6a8759]'1968-02-02'[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#9876aa]$start [/COLOR]= [COLOR=#9876aa]$row[/COLOR][COLOR=#cc7832];
[/COLOR][COLOR=#cc7832]
[/COLOR][COLOR=#9876aa]$dateOfStart [/COLOR]= [COLOR=#9876aa]$start[/COLOR][COLOR=#cc7832];
[/COLOR][COLOR=#9876aa]$today [/COLOR]= date([COLOR=#6a8759]"2016-02-02"[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#cc7832]
[/COLOR][COLOR=#9876aa]$diff [/COLOR]= abs([COLOR=#9876aa]$dateOfStart [/COLOR]- [COLOR=#9876aa]$today[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#cc7832]
[/COLOR][COLOR=#9876aa]$a[/COLOR]=explode([COLOR=#6a8759]' '[/COLOR][COLOR=#cc7832],[/COLOR][COLOR=#9876aa]$diff[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#cc7832][B]if[/B][/COLOR]([COLOR=#9876aa]$a[/COLOR][[COLOR=#6897bb]0[/COLOR]]&gt;[COLOR=#6897bb]1[/COLOR]){
    [COLOR=#9876aa]$y[/COLOR]=[COLOR=#9876aa]$a[/COLOR][[COLOR=#6897bb]0[/COLOR]].[COLOR=#6a8759]"  anni  "[/COLOR][COLOR=#cc7832];
[/COLOR]}[COLOR=#cc7832][B]else
[/B][/COLOR][COLOR=#cc7832][B]  [/B][/COLOR]{[COLOR=#9876aa]$y[/COLOR]=[COLOR=#9876aa]$diff[/COLOR].[COLOR=#6a8759]"  anno"[/COLOR][COLOR=#cc7832];
[/COLOR]}

[COLOR=#cc7832][B]echo [/B][/COLOR][COLOR=#6a8759]'&lt;div style="color:#0000FF;"&gt;'[/COLOR].[COLOR=#9876aa]$y[/COLOR].[COLOR=#6a8759]' nel cinema.&lt;/div&gt;'[/COLOR][COLOR=#cc7832];
[/COLOR][COLOR=#cc7832][B]?&gt;[/B][/COLOR][COLOR=#cc7832][B]
[/B][/COLOR]
</code></pre>
<blockquote>
<p dir="auto">48  anni   nel cinema.</p>
</blockquote>
]]></description><link>https://dev.connect.gt/post/1259196</link><guid isPermaLink="true">https://dev.connect.gt/post/1259196</guid><dc:creator><![CDATA[chiabgigi]]></dc:creator><pubDate>Tue, 10 Sep 2019 08:44:55 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Tue, 10 Sep 2019 08:01:01 GMT]]></title><description><![CDATA[<p dir="auto">ciao <a href="http://www.giorgiotave.it/forum/members/chiabgigi.html" rel="nofollow ugc"><strong>chiabgigi</strong></a>, a questo ci ero arrivato, pero' bisogna integrare il codice sopra (con today, anni, anno, start) con questo, ho provato ma si vede che sono negato</p>
]]></description><link>https://dev.connect.gt/post/1259212</link><guid isPermaLink="true">https://dev.connect.gt/post/1259212</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Tue, 10 Sep 2019 08:01:01 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Tue, 10 Sep 2019 07:52:22 GMT]]></title><description><![CDATA[<pre><code>[COLOR=#9876aa]$start_date [/COLOR]= date_create([COLOR=#6a8759]"1968-01-01"[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#9876aa]$end_date [/COLOR]= date_create([COLOR=#6a8759]"2016-01-01"[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#cc7832]
[/COLOR][COLOR=#9876aa]$diff [/COLOR]= date_diff([COLOR=#9876aa]$start_date[/COLOR][COLOR=#cc7832],[/COLOR][COLOR=#9876aa]$end_date[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#cc7832][B]echo [/B][/COLOR][COLOR=#6a8759]"Difference between two dates: "[/COLOR].[COLOR=#9876aa]$diff[/COLOR]-&gt;[COLOR=#ffc66d]format[/COLOR]([COLOR=#6a8759]"%y"[/COLOR]). [COLOR=#6a8759]"years"[/COLOR][COLOR=#cc7832];

/* oppure */

[/COLOR]
[COLOR=#cc7832][B]echo [/B][/COLOR][COLOR=#6a8759]"Difference: " [/COLOR].[COLOR=#9876aa]$diff[/COLOR]-&gt;[COLOR=#9876aa]y [/COLOR]. [COLOR=#6a8759]" years, &lt;br&gt;" [/COLOR]. [COLOR=#9876aa]$diff[/COLOR]-&gt;[COLOR=#9876aa]m [/COLOR]. [COLOR=#6a8759]" months, &lt;br&gt;" [/COLOR]. [COLOR=#9876aa]$diff[/COLOR]-&gt;[COLOR=#9876aa]d [/COLOR]. [COLOR=#6a8759]" days."[/COLOR][COLOR=#cc7832];
[/COLOR][COLOR=#cc7832]
[/COLOR]
</code></pre>
<blockquote>
<p dir="auto">Difference between two dates: 48years</p>
</blockquote>
<blockquote>
<p dir="auto">Difference:<br />
48 years,<br />
0 months,<br />
0 days.</p>
</blockquote>
]]></description><link>https://dev.connect.gt/post/1259195</link><guid isPermaLink="true">https://dev.connect.gt/post/1259195</guid><dc:creator><![CDATA[chiabgigi]]></dc:creator><pubDate>Tue, 10 Sep 2019 07:52:22 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Tue, 10 Sep 2019 06:56:39 GMT]]></title><description><![CDATA[<p dir="auto">chiabgigi ciao,<br />
perfetto, funziona adesso <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<pre><code class="language-php">&lt;?php // code calcolo anno code by chiabgigi from forum GT

$start = $row['start'];

$dateOfStart = $start;
$today = date("Y-m-d");
$diff = abs($dateOfStart - $today);

$a=explode(' ',$diff);
if($a[0]&gt;1){
    $y=$a[0]."  anni  ";
}else{$y=$diff."  anno";}

 
echo   '&lt;font color="blue"&gt;'. $y . '&amp;nbsp' . nel .'&amp;nbsp'. Cinema . '&lt;/font&gt;';
 
?&gt;
</code></pre>
<p dir="auto">mi sono accorto che ho commesso un errore, questo codice serve per calcolare quanto anni l'attore ha lavorato nel cinema, questo va bene se ancora attivo, ma io<br />
ho inserito un altro campo per segnalare la fine carriera, questo:</p>
<p dir="auto"><strong>end</strong>                     --------------&gt; year(4)</p>
<p dir="auto">si potrebbe fare che se e' vuoto il campo <strong>end</strong> continua il conteggio con la l'anno attuale (<strong>today</strong>), ma se e' compilato conteggiare gli anni trascorsi tra <strong>start</strong> e <strong>end</strong></p>
<p dir="auto"><strong>riepilogo campi:</strong></p>
<p dir="auto"><strong>start</strong> --------------&gt; year(4)</p>
<p dir="auto"><strong>end</strong> --------------&gt; year(4)</p>
<p dir="auto">qui un esempio, dovrebbe calcolarmi 48 anni e non 51</p>
<p dir="auto"><img src="https://i.imgur.com/ZTeBx9c.png" alt="" class="img-markdown  img-fluid" /></p>
<p dir="auto">grazie ancora</p>
]]></description><link>https://dev.connect.gt/post/1259211</link><guid isPermaLink="true">https://dev.connect.gt/post/1259211</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Tue, 10 Sep 2019 06:56:39 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 21:04:33 GMT]]></title><description><![CDATA[<pre><code>[COLOR=#9876AA][FONT=&amp;quot]$diff [/FONT][/COLOR][COLOR=#A9B7C6][FONT=&amp;quot]= abs([/FONT][/COLOR][COLOR=#9876AA][FONT=&amp;quot]$dateOfStart [/FONT][/COLOR][COLOR=#A9B7C6][FONT=&amp;quot]- [/FONT][/COLOR][COLOR=#9876AA][FONT=&amp;quot]$today[/FONT][/COLOR][COLOR=#A9B7C6][FONT=&amp;quot])[/FONT][/COLOR][COLOR=#CC7832][FONT=&amp;quot];[/FONT][/COLOR]
[COLOR=#cc7832]
[/COLOR][COLOR=#9876aa]$a[/COLOR]=explode([COLOR=#6a8759]' '[/COLOR][COLOR=#cc7832],[/COLOR][COLOR=#9876aa]$diff[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#cc7832][B]if[/B][/COLOR]([COLOR=#9876aa]$a[/COLOR][[COLOR=#6897bb]0[/COLOR]]&gt;[COLOR=#6897bb]1[/COLOR]){
    [COLOR=#9876aa]$y[/COLOR]=[COLOR=#9876aa]$a[/COLOR][[COLOR=#6897bb]0[/COLOR]].[COLOR=#6a8759]"  anni  "[/COLOR][COLOR=#cc7832];
[/COLOR]}[COLOR=#cc7832][B]else[/B][/COLOR]{[COLOR=#9876aa]$y[/COLOR]=[COLOR=#9876aa]$diff[/COLOR].[COLOR=#6a8759]"  anno"[/COLOR][COLOR=#cc7832];[/COLOR]}
[COLOR=#CC7832][FONT=&amp;quot][B]echo [/B][/FONT][/COLOR][COLOR=#9876AA][FONT=&amp;quot]$y[/FONT][/COLOR][COLOR=#CC7832][FONT=&amp;quot];[/FONT][/COLOR]
</code></pre>
]]></description><link>https://dev.connect.gt/post/1259194</link><guid isPermaLink="true">https://dev.connect.gt/post/1259194</guid><dc:creator><![CDATA[chiabgigi]]></dc:creator><pubDate>Mon, 09 Sep 2019 21:04:33 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 20:48:08 GMT]]></title><description><![CDATA[<p dir="auto">:bho:non funziona<br />
visualizza sempre Anni</p>
<pre><code class="language-php">$start = $row['start'];

$dateOfStart = $start;
$today = date("Y-m-d");
$diff = abs($dateOfStart - $today);

$a=explode(' ',$diff);
if($a[0]&gt;0){
    $y=$a[0]."  anni  ";
}else{$y="  anno";}
echo $y;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1259210</link><guid isPermaLink="true">https://dev.connect.gt/post/1259210</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Mon, 09 Sep 2019 20:48:08 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 20:25:46 GMT]]></title><description><![CDATA[<pre><code>[COLOR=#9876AA][FONT=&amp;quot]$diff [/FONT][/COLOR][COLOR=#A9B7C6][FONT=&amp;quot]= abs([/FONT][/COLOR][COLOR=#9876AA][FONT=&amp;quot]$dateOfStart [/FONT][/COLOR][COLOR=#A9B7C6][FONT=&amp;quot]- [/FONT][/COLOR][COLOR=#9876AA][FONT=&amp;quot]$today[/FONT][/COLOR][COLOR=#A9B7C6][FONT=&amp;quot])[/FONT][/COLOR][COLOR=#CC7832][FONT=&amp;quot];[/FONT][/COLOR]
[COLOR=#cc7832]
[/COLOR][COLOR=#9876aa]$a[/COLOR]=explode([COLOR=#6a8759]' '[/COLOR][COLOR=#cc7832],[/COLOR][COLOR=#9876aa]$diff[/COLOR])[COLOR=#cc7832];
[/COLOR][COLOR=#cc7832][B]if[/B][/COLOR]([COLOR=#9876aa]$a[/COLOR][[COLOR=#6897bb]0[/COLOR]]&gt;[COLOR=#6897bb]0[/COLOR]){
    [COLOR=#9876aa]$y[/COLOR]=[COLOR=#9876aa]$a[/COLOR][[COLOR=#6897bb]0[/COLOR]].[COLOR=#6a8759]"  anni  "[/COLOR][COLOR=#cc7832];
[/COLOR]}[COLOR=#cc7832][B]else[/B][/COLOR]{[COLOR=#9876aa]$y[/COLOR]=[COLOR=#6a8759]"  anno"[/COLOR][COLOR=#cc7832];[/COLOR]}
[COLOR=#CC7832][FONT=&amp;quot][B]echo [/B][/FONT][/COLOR][COLOR=#9876AA][FONT=&amp;quot]$y[/FONT][/COLOR][COLOR=#CC7832][FONT=&amp;quot];[/FONT][/COLOR]
</code></pre>
]]></description><link>https://dev.connect.gt/post/1259193</link><guid isPermaLink="true">https://dev.connect.gt/post/1259193</guid><dc:creator><![CDATA[chiabgigi]]></dc:creator><pubDate>Mon, 09 Sep 2019 20:25:46 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 18:09:47 GMT]]></title><description><![CDATA[<p dir="auto">ho adattato questo, ma non va <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /></p>
<pre><code class="language-php">$start = $row['start'];

$dateOfStart = $start;
$today = date("Y-m-d");


$daysleft = $dateOfStart-&gt;diff($today)-&gt;format('%a'); echo $daysleft.' '.($daysleft ==1?'Anno':'Anni').' remaining';?&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1259201</link><guid isPermaLink="true">https://dev.connect.gt/post/1259201</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Mon, 09 Sep 2019 18:09:47 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 17:02:04 GMT]]></title><description><![CDATA[<p dir="auto">prova ad adattare questo al tuo codice (io nn posso testarlo)</p>
<pre><code>[COLOR=#303336][FONT=inherit]$daysleft [/FONT][/COLOR][COLOR=#303336][FONT=inherit]=[/FONT][/COLOR][COLOR=#303336][FONT=inherit] $date2[/FONT][/COLOR][COLOR=#303336][FONT=inherit]-&gt;[/FONT][/COLOR][COLOR=#303336][FONT=inherit]diff[/FONT][/COLOR][COLOR=#303336][FONT=inherit]([/FONT][/COLOR][COLOR=#303336][FONT=inherit]$date1[/FONT][/COLOR][COLOR=#303336][FONT=inherit])-&gt;[/FONT][/COLOR][COLOR=#303336][FONT=inherit]format[/FONT][/COLOR][COLOR=#303336][FONT=inherit]([/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]'%a'[/FONT][/COLOR][COLOR=#303336][FONT=inherit]);
[/FONT][/COLOR][COLOR=#303336][FONT=inherit]echo $daysleft[/FONT][/COLOR][COLOR=#303336][FONT=inherit].[/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]' '[/FONT][/COLOR][COLOR=#303336][FONT=inherit].([/FONT][/COLOR][COLOR=#303336][FONT=inherit]$daysleft [/FONT][/COLOR][COLOR=#303336][FONT=inherit]==[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]1[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]?[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]'day'[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#303336][FONT=inherit]:[/FONT][/COLOR][COLOR=#303336][FONT=inherit] [/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]'days'[/FONT][/COLOR][COLOR=#303336][FONT=inherit]).[/FONT][/COLOR][COLOR=#7D2727][FONT=inherit]' remaining'[/FONT][/COLOR][COLOR=#303336][FONT=inherit];[/FONT][/COLOR]
</code></pre>
]]></description><link>https://dev.connect.gt/post/1259190</link><guid isPermaLink="true">https://dev.connect.gt/post/1259190</guid><dc:creator><![CDATA[chiabgigi]]></dc:creator><pubDate>Mon, 09 Sep 2019 17:02:04 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 16:41:46 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><strong>Alex_2019</strong></p>
<p dir="auto"><img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /> grazie chiabgigi</p>
<pre><code class="language-php">echo $diff = abs ($dateOfStart - $today ) . '&amp;nbsp' . Anni .'&amp;nbsp' . in .'&amp;nbsp' .totale .'&amp;nbsp''';
</code></pre>
<p dir="auto">mi restituisce quello che volevo</p>
<p dir="auto">mi chiedevo se era possibile visualizzare l'anno in modo dinamico</p>
<p dir="auto">esempio:</p>
<p dir="auto">1 Ann<strong>o</strong> in totale</p>
<p dir="auto">2 Ann<strong>i</strong> in totale</p>
</blockquote>
<p dir="auto">ho risolto con il tuo codice, io chiedevo un'altra cosa aggiuntiva.</p>
<p dir="auto">Se gli anni sono uno visualizzare l'etichetta <strong>Anno</strong>, se piu' di uno visualizzare <strong>Anni</strong></p>
]]></description><link>https://dev.connect.gt/post/1259200</link><guid isPermaLink="true">https://dev.connect.gt/post/1259200</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Mon, 09 Sep 2019 16:41:46 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 16:27:55 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://www.geeksforgeeks.org/how-to-calculate-the-difference-between-two-dates-in-php/" rel="nofollow ugc">https://www.geeksforgeeks.org/how-to-calculate-the-difference-between-two-dates-in-php/</a></p>
]]></description><link>https://dev.connect.gt/post/1259191</link><guid isPermaLink="true">https://dev.connect.gt/post/1259191</guid><dc:creator><![CDATA[chiabgigi]]></dc:creator><pubDate>Mon, 09 Sep 2019 16:27:55 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 16:19:17 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><strong>chiabgigi</strong></p>
<pre><code>$diff = abs($date2 - $date1);
</code></pre>
</blockquote>
<p dir="auto"><img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=12b9555a9a1" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /> grazie chiabgigi</p>
<pre><code class="language-php">echo $diff = abs ($dateOfStart - $today ) . '&amp;nbsp' . Anni .'&amp;nbsp' . in .'&amp;nbsp' .totale .'&amp;nbsp''';
</code></pre>
<p dir="auto">mi restituisce quello che volevo</p>
<p dir="auto">mi chiedevo se era possibile visualizzare l'anno in modo dinamico</p>
<p dir="auto">esempio:</p>
<p dir="auto">1 Ann<strong>o</strong> in totale</p>
<p dir="auto">2 Ann<strong>i</strong> in totale</p>
]]></description><link>https://dev.connect.gt/post/1259199</link><guid isPermaLink="true">https://dev.connect.gt/post/1259199</guid><dc:creator><![CDATA[alex.2019]]></dc:creator><pubDate>Mon, 09 Sep 2019 16:19:17 GMT</pubDate></item><item><title><![CDATA[Reply to Calcolo anno tra 2 date on Mon, 09 Sep 2019 08:35:57 GMT]]></title><description><![CDATA[<pre><code>$diff = abs($date2 - $date1);
</code></pre>
]]></description><link>https://dev.connect.gt/post/1259197</link><guid isPermaLink="true">https://dev.connect.gt/post/1259197</guid><dc:creator><![CDATA[chiabgigi]]></dc:creator><pubDate>Mon, 09 Sep 2019 08:35:57 GMT</pubDate></item></channel></rss>