<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Made in Software &#187; date</title>
	<atom:link href="http://www.madeinsoftware.it/index.php/tag/date/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.madeinsoftware.it</link>
	<description>In un mondo fatto di software, consigli pratici per gli sviluppatori</description>
	<lastBuildDate>Mon, 26 Jul 2010 09:17:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Estrarre il giorno da una data in JAVA</title>
		<link>http://www.madeinsoftware.it/index.php/2009/05/13/estrarre-il-giorno-da-una-data-in-java/</link>
		<comments>http://www.madeinsoftware.it/index.php/2009/05/13/estrarre-il-giorno-da-una-data-in-java/#comments</comments>
		<pubDate>Wed, 13 May 2009 11:50:00 +0000</pubDate>
		<dc:creator>dinox</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://www.madeinsoftware.it/?p=67</guid>
		<description><![CDATA[Un modo davvero facile per estrarre solo il giorno da una data in JAVA]]></description>
			<content:encoded><![CDATA[<p>Torniamo sulla questione delle date in JAVA e vediamo come estrarre il giorno da una data:</p>
<p><code>public String getGiorno(Date d) {<br />
try {<br />
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");<br />
String giorno = sdf.format(d);<br />
return giorno;<br />
}<br />
catch (Exception e) {<br />
e.printStackTrace();<br />
return "";<br />
}<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.madeinsoftware.it/index.php/2009/05/13/estrarre-il-giorno-da-una-data-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calcolare il tempo in ore, min e sec fra due date</title>
		<link>http://www.madeinsoftware.it/index.php/2009/04/30/calcolare-il-tempo-in-ore-min-e-sec-fra-due-date/</link>
		<comments>http://www.madeinsoftware.it/index.php/2009/04/30/calcolare-il-tempo-in-ore-min-e-sec-fra-due-date/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 11:27:14 +0000</pubDate>
		<dc:creator>dinox</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://www.madeinsoftware.it/?p=28</guid>
		<description><![CDATA[Ecco come ottenere una stringa del tipo hh:mm:ss che indica il tempo che intercorre fra due date in JAVA]]></description>
			<content:encoded><![CDATA[<p>Quello delle date i JAVA Ã¨ un problema abbastanza intricato da venirne facilmente fuori. Ecco dunque, per la serie &#8216;funzioni che possono sempre servire&#8217;, un modo per calcolare il numero di ore fra due date e tornarle con una stringa formattata:</p>
<p><code>/**<br />
* Calcula il numero di ore fra due date.<br />
*<br />
* @param d1Â Â Â  La prima data.<br />
* @param d2Â Â Â  La seconda data.<br />
*<br />
* @returnÂ  Numero di ore fra le due date in una stringa formattata hh:mm:ss.<br />
*/<br />
public static String getOreFraDate (java.util.Date d1, java.util.Date d2) {<br />
// scambia le date se ce ne fosse la necessitÃ<br />
if (d1.after(d2)) {<br />
Date swap = d1;<br />
d1 = d2;<br />
d2 = swap;<br />
}<br />
double tempoTotale = d2.getTime() - d1.getTime();<br />
int h = (int)(tempoTotale / (1000 * 60 * 60));<br />
tempoTotale = tempoTotale - (h * 1000 * 60 * 60);<br />
int m = (int)(tempoTotale / (1000 * 60));<br />
tempoTotale = tempoTotale - (m * 1000 * 60);<br />
int s = (int)(tempoTotale / (1000));<br />
return h + ":" + m + ":" + s;<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.madeinsoftware.it/index.php/2009/04/30/calcolare-il-tempo-in-ore-min-e-sec-fra-due-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aggiungere o sottrarre giorni da una data JAVA</title>
		<link>http://www.madeinsoftware.it/index.php/2009/04/28/aggiungere-o-sottrarre-giorni-da-una-data-java/</link>
		<comments>http://www.madeinsoftware.it/index.php/2009/04/28/aggiungere-o-sottrarre-giorni-da-una-data-java/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 08:06:56 +0000</pubDate>
		<dc:creator>dinox</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://www.madeinsoftware.it/?p=19</guid>
		<description><![CDATA[Lavorare con le date in JAVA puÃ² essere complicato. Ecco un modo per aggiungere o sottrarre giorni]]></description>
			<content:encoded><![CDATA[<p>Chi lavora con JAVA sa quanto possa essere complicato gestire le date. Ecco dunque un metodo molto semplice per aggiungere o sottrarre giorni da una data JAVA:</p>
<p><code>/**<br />
* Aggiungi (sottrai) g (-g) giorni alla data d.<br />
* @param d<br />
* @param g<br />
* @return la nuova data<br />
*/<br />
public static Date addDays(Date d, int g) {<br />
Calendar c = Calendar.getInstance();<br />
c.setTime(d);<br />
c.add(Calendar.DATE, g);<br />
return  c.getTime();<br />
}<br />
</code></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.madeinsoftware.it/index.php/2009/04/28/aggiungere-o-sottrarre-giorni-da-una-data-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
