<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>date &#8211; MaxVergelli.com</title>
	<atom:link href="https://www.maxvergelli.com/tag/date/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.maxvergelli.com</link>
	<description>sourcecode repository</description>
	<lastBuildDate>Sat, 11 Apr 2020 18:40:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i2.wp.com/www.maxvergelli.com/wp-content/uploads/2020/04/wp-1586823685141.png?fit=32%2C32&#038;ssl=1</url>
	<title>date &#8211; MaxVergelli.com</title>
	<link>https://www.maxvergelli.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">34603511</site>	<item>
		<title>Display the total number of days between two dates in PHP</title>
		<link>https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/</link>
					<comments>https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Fri, 10 Apr 2020 14:30:00 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[String Manipulation Algorithms]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[count-days]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date-conversion]]></category>
		<category><![CDATA[date-interval]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[time-difference]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=147</guid>

					<description><![CDATA[PHP: How to display the total number of days between two dates in PHP, using the DateTime class and compare them via diff() method]]></description>
										<content:encoded><![CDATA[<p>To count the total number of days between two dates, use the <code>DateTime</code> class and compare them via <code>diff()</code> method with the following few lines of code</p>


<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;php&quot;,&quot;mime&quot;:&quot;text/x-php&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;PHP&quot;,&quot;modeName&quot;:&quot;php&quot;}">$date1 = new DateTime('2020-01-01'); 
$date2 = new DateTime('2020-02-15'); 
print_r($date1-&gt;diff($date2));</pre></div>



<p>And the output will be:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application/json&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;languageLabel&quot;:&quot;no&quot;,&quot;language&quot;:&quot;JSON&quot;,&quot;modeName&quot;:&quot;json&quot;}">DateInterval Object ( 
  [y] =&gt; 0 
  [m] =&gt; 1 
  [d] =&gt; 14 
  [h] =&gt; 0 
  [i] =&gt; 0 
  [s] =&gt; 0 
  [f] =&gt; 0 
  [weekday] =&gt; 0 
  [weekday_behavior] =&gt; 0 
  [first_last_day_of] =&gt; 0 
  [invert] =&gt; 0 
  [days] =&gt; 45 
  [special_type] =&gt; 0 
  [special_amount] =&gt; 0 
  [have_weekday_relative] =&gt; 0 
  [have_special_relative] =&gt; 0 
)</pre></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/how-to-display-total-number-of-days-between-two-dates-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">147</post-id>	</item>
		<item>
		<title>Convert a DateTime string to a Unix timestamp in VbScript / Classic ASP</title>
		<link>https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/</link>
					<comments>https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Wed, 18 Mar 2020 14:10:43 +0000</pubDate>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MS Access]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[String Manipulation Algorithms]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[classic-asp]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date-conversion]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[datetime-conversion]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[mysql-datetime]]></category>
		<category><![CDATA[mysql-datetime-conversion]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[unix-timestamp]]></category>
		<category><![CDATA[vbscript]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=124</guid>

					<description><![CDATA[To convert a datetime string value like &#8220;YYYY-MM-DD HH:MM:SS&#8221; to a Unix timestamp (the seconds from 01/01/1970 to the input datetime) You can use a conversion function as the following: Then, to get back the datetime from the Unix timestamp &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/" aria-label="Convert a DateTime string to a Unix timestamp in VbScript / Classic ASP">Read More</a>]]></description>
										<content:encoded><![CDATA[<p>To convert a datetime string value like &#8220;YYYY-MM-DD HH:MM:SS&#8221; to a Unix timestamp (the seconds from 01/01/1970 to the input datetime) You can use a conversion function as the following:</p>


<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;vbscript&quot;,&quot;mime&quot;:&quot;text/vbscript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;VBScript&quot;,&quot;modeName&quot;:&quot;vb&quot;}">Function ConvertToUnixTimeStamp(input_datetime) 'As String 
  Dim d
  d = CDate(input_datetime) 
  ConvertToUnixTimeStamp = CStr(DateDiff(&quot;s&quot;, &quot;01/01/1970 00:00:00&quot;, d)) 
End Function</pre></div>



<p>Then, to get back the datetime from the Unix timestamp use the following code:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;mode&quot;:&quot;vbscript&quot;,&quot;mime&quot;:&quot;text/vbscript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:true,&quot;readOnly&quot;:true,&quot;language&quot;:&quot;VBScript&quot;,&quot;modeName&quot;:&quot;vb&quot;}">Function ConvertUnixTimeStampToDateTime(input_unix_timestamp) 'As String [regular datetime] 
  ConvertUnixTimeStampToDateTime = CStr(DateAdd(&quot;s&quot;, input_unix_timestamp, &quot;01/01/1970 00:00:00&quot;)) 
End Function</pre></div>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/convert-a-datetime-string-to-a-unix-timestamp-in-vbscript-classic-asp/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">124</post-id>	</item>
		<item>
		<title>PHP Date or Datetime to MySQL Datetime and viceversa</title>
		<link>https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/</link>
					<comments>https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/#respond</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Sat, 21 Dec 2019 15:10:11 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[String Manipulation Algorithms]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[conversione]]></category>
		<category><![CDATA[data-layer]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[datetime-conversion]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[helper-class]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql-datetime]]></category>
		<category><![CDATA[mysql-datetime-conversion]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string-conversion]]></category>
		<category><![CDATA[string-manipulation]]></category>
		<guid isPermaLink="false">http://www.maxvergelli.com/?p=59</guid>

					<description><![CDATA[Two useful PHP functions to convert normal date/datetime (&#8220;25.12.2010 12:10:00&#8221; or &#8220;25.12.2010&#8221;) to MySQL datetime (like &#8220;2010-12-25 12:10:00&#8221; or &#8220;2010-12-25 00:00:00&#8243;); You can get back a date/datetime from MySQL datetime too: [sourcecode language=&#8221;php&#8221;] function datetime2mysqldatetime($datetime){ // &#8216;25.12.2010 12:10:00&#8217; -&#62; &#8216;2010-12-25 &#8230; <a class="kt-excerpt-readmore" href="https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/" aria-label="PHP Date or Datetime to MySQL Datetime and viceversa">Read More</a>]]></description>
										<content:encoded><![CDATA[<p>Two useful PHP functions to convert normal date/datetime (&#8220;25.12.2010 12:10:00&#8221; or &#8220;25.12.2010&#8221;) to MySQL datetime (like &#8220;2010-12-25 12:10:00&#8221; or &#8220;2010-12-25 00:00:00&#8243;); You can get back a date/datetime from MySQL datetime too:</p>
<p>[sourcecode language=&#8221;php&#8221;]<br />
	function datetime2mysqldatetime($datetime){				// &#8216;25.12.2010 12:10:00&#8217; -&gt; &#8216;2010-12-25 12:10:00&#8217;<br />
		return date(&#8216;Y-m-d H:i:s&#8217;, strtotime($datetime)); 	// &#8216;25.12.2010&#8217; 		 -&gt; &#8216;2010-12-25 00:00:00&#8217;<br />
	}</p>
<p>	function mysqldatetime2datetime($mysql_datetime){	// &#8216;2010-12-25 12:10:00&#8217; -&gt; &#8216;25.12.2010 12:10:00&#8217;<br />
		$d = split(&#8216; &#8216;, $mysql_datetime);				// &#8216;2010-12-25&#8217; 		 -&gt; &#8216;25.12.2010&#8217;<br />
		if($d &amp;&amp; count($d)&gt;1){<br />
			list($year, $month, $day) = split(&#8216;-&#8216;, $d[0]);<br />
			list($hour, $minute, $second) = split(&#8216;:&#8217;, $d[1]);<br />
			$d = date(&#8216;d.m.Y H:i:s&#8217;, mktime($hour, $minute, $second, $month, $day, $year));}<br />
		else if($d &amp;&amp; count($d)==1){<br />
			list($year, $month, $day) = split(&#8216;-&#8216;, $d[0]);<br />
			$d = date(&#8216;d.m.Y&#8217;, mktime(0, 0, 0, $month, $day, $year));<br />
		} else {<br />
			$d = NULL;<br />
		}<br />
		return $d;<br />
	}<br />
[/sourcecode]</p>
<p>Max 🙂</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.maxvergelli.com/php-date-or-datetime-to-mysql-datetime-and-viceversa/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">59</post-id>	</item>
	</channel>
</rss>
