<?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>Evolution Systems &#187; Time</title>
	<atom:link href="http://evolution-systems.co.uk/tag/time/feed/" rel="self" type="application/rss+xml" />
	<link>http://evolution-systems.co.uk</link>
	<description>Web Development, Software Development and Linux Consultancy services</description>
	<lastBuildDate>Fri, 08 Aug 2025 09:18:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Convert MySql timestamp field to Unix Time Stamp</title>
		<link>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/</link>
		<comments>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 16:48:23 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Functions]]></category>
		<category><![CDATA[Time]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=511</guid>
		<description><![CDATA[As anyone who has used MySql and PHP in the past to deal with time and date will probably know MySql timestamp fields are not compatible in anyway with PHP&#8217;s date() function. Because of this you need to do conversions in order to use the information from the MySql database. The following function will convert [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As anyone who has used MySql and PHP in the past to deal with time and date will probably know MySql timestamp fields are not compatible in anyway with PHP&#8217;s date() function. Because of this you need to do conversions in order to use the information from the MySql database. The following function will convert a value from a database into a unix timestamp format for easier manipulation within your PHP code. I have found it quite useful to have around so am putting it up here for others to take advantage of.</p>
<p><code>/*<br />  * Convert MySql timestamp to unix timestamp<br />  */<br />function ts2unix($ts)<br />{<br />  $year    = substr($ts,0,4);<br />  $month   = substr($ts,4,2);<br />  $day     = substr($ts,6,2);<br />  $hour    = substr($ts,8,2);<br />  $minute  = substr($ts,10,2);<br />  $second  = substr($ts,12,2);<br />  $uts = mktime($hour,$minute,$second,$month,$day,$year);<br />  return ($uts);<br />}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
