<?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>data &#8211; SMsoft &#8211; informatica e dintorni</title>
	<atom:link href="https://blog.smsoft.it/tag/data/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.smsoft.it</link>
	<description>consigli settimanali su MacOS, GNU/Linux ed Open Source</description>
	<lastBuildDate>Tue, 06 Mar 2018 08:30:25 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=93434</generator>
	<item>
		<title>PHP: recuperare data di inizio e fine della settimana precedente</title>
		<link>https://blog.smsoft.it/2018/03/06/php-recuperare-data-inizio-fine-della-settimana-precedente/</link>
					<comments>https://blog.smsoft.it/2018/03/06/php-recuperare-data-inizio-fine-della-settimana-precedente/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 06 Mar 2018 08:30:25 +0000</pubDate>
				<category><![CDATA[Html e PHP]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[settimana precedente]]></category>
		<guid isPermaLink="false">https://blog.smsoft.it/?p=4001</guid>

					<description><![CDATA[Ecco qui una semplice funzione che può tornarvi utile per recuperare inizio e fine della precedente settimana: function get_prev_week(){ $previous_week = strtotime("-1 week +1 day"); $start_week = strtotime("last sunday midnight",$previous_week); $end_week = strtotime("next saturday",$start_week); $start_week = date("Y-m-d",$start_week); $end_week = date("Y-m-d",$end_week); return array('start_week'=>$start_week, 'end_week'=>$end_week); } enjoy!]]></description>
										<content:encoded><![CDATA[<p>Ecco qui una semplice funzione che può tornarvi utile per recuperare inizio e fine della precedente settimana:<br />
<code>function get_prev_week(){<br />
  $previous_week = strtotime("-1 week +1 day");<br />
  $start_week = strtotime("last sunday midnight",$previous_week);<br />
  $end_week = strtotime("next saturday",$start_week);</p>
<p>  $start_week = date("Y-m-d",$start_week);<br />
  $end_week = date("Y-m-d",$end_week);<br />
  return array('start_week'=>$start_week, 'end_week'=>$end_week);<br />
}</code></p>
<p>enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2018/03/06/php-recuperare-data-inizio-fine-della-settimana-precedente/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQLite: cercare date scritte in formato italiano</title>
		<link>https://blog.smsoft.it/2017/06/13/sqlite-cercare-date-scritte-formato-italiano/</link>
					<comments>https://blog.smsoft.it/2017/06/13/sqlite-cercare-date-scritte-formato-italiano/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 13 Jun 2017 08:30:53 +0000</pubDate>
				<category><![CDATA[Html e PHP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[italian]]></category>
		<category><![CDATA[italiano]]></category>
		<category><![CDATA[SQLite]]></category>
		<guid isPermaLink="false">https://blog.smsoft.it/?p=3736</guid>

					<description><![CDATA[SQLite non ha un vero formato data e quindi il confronto viene fatto come se si trattasse di una stringa. Per questo motivo è importante salvare la data in formato Y-m-d in modo da poter cercare, ad esempio, date &#8220;maggiori di&#8221; o date &#8220;comprese tra&#8221;. Se abbiamo nel DB la data salvata nel campo chiamato ... <a title="SQLite: cercare date scritte in formato italiano" class="read-more" href="https://blog.smsoft.it/2017/06/13/sqlite-cercare-date-scritte-formato-italiano/" aria-label="Per saperne di più su SQLite: cercare date scritte in formato italiano">Leggi tutto</a>]]></description>
										<content:encoded><![CDATA[<p>SQLite non ha un vero <a href="http://www.sqlite.org/datatype3.html" target="_blank" rel="noopener noreferrer">formato data</a> e quindi il confronto viene fatto come se si trattasse di una stringa. Per questo motivo è importante salvare la data in formato Y-m-d in modo da poter cercare, ad esempio, date &#8220;maggiori di&#8221; o date &#8220;comprese tra&#8221;.</p>
<p>Se abbiamo nel DB la data salvata nel campo chiamato <strong>column</strong> in formato italiano dd/MM/yyyy, possiamo facilmente convertirne il formato in yyyyMMdd e fare ricerche, ad esempio:</p>
<p><code>SELECT * FROM XXXX WHERE substr(column,7)||substr(column,4,2)||substr(column,1,2) between '20170101' and '20170201'</code></p>
<p>oppure:<br />
<code>SELECT * FROM XXXX WHERE substr(column,7)||substr(column,4,2)||substr(column,1,2)>'201706060 </code></p>
<p>enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.smsoft.it/2017/06/13/sqlite-cercare-date-scritte-formato-italiano/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
