<?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>Beaver6813.com &#187; time</title>
	<atom:link href="http://beaver6813.com/tag/time/feed/" rel="self" type="application/rss+xml" />
	<link>http://beaver6813.com</link>
	<description>Web Developer Extraordinaire!</description>
	<lastBuildDate>Sat, 10 Jul 2010 18:36:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1-RC1</generator>
		<item>
		<title>[PHP] Get current time in milliseconds</title>
		<link>http://beaver6813.com/2009/10/php-get-current-time-in-milliseconds/</link>
		<comments>http://beaver6813.com/2009/10/php-get-current-time-in-milliseconds/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 17:59:31 +0000</pubDate>
		<dc:creator>Beaver6813</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[milliseconds]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timer]]></category>

		<guid isPermaLink="false">http://beaver6813.com/?p=100</guid>
		<description><![CDATA[I recently needed to get the current time in milliseconds, of course this can easily be retrieved using microtime() however I needed the entire number in digits, not in decimals with seconds seperately etc. Heres how: ?View Code PHP1 2 3 $timeparts = explode&#40;&#34; &#34;,microtime&#40;&#41;&#41;; $currenttime = bcadd&#40;&#40;$timeparts&#91;0&#93;*1000&#41;,bcmul&#40;$timeparts&#91;1&#93;,1000&#41;&#41;; echo $currenttime; NOTE: PHP5 is required for [...]


Related posts:<ol><li><a href='http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/' rel='bookmark' title='Permanent Link: PHP Search and Replace Directory Recursively'>PHP Search and Replace Directory Recursively</a></li>
<li><a href='http://beaver6813.com/2010/05/decor-scene/' rel='bookmark' title='Permanent Link: Decor Scene'>Decor Scene</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Permanent Link: Jokepants'>Jokepants</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I recently needed to get the current time in milliseconds, of course this can easily be retrieved using microtime() however I needed the entire number in digits, not in decimals with seconds seperately etc. Heres how:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p100code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1002"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p100code2"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$timeparts</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><a href="http://www.php.net/microtime"><span style="color: #990000;">microtime</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$currenttime</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/bcadd"><span style="color: #990000;">bcadd</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$timeparts</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><a href="http://www.php.net/bcmul"><span style="color: #990000;">bcmul</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$timeparts</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$currenttime</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><em>NOTE: PHP5 is required for this function due to the improvements with microtime() and the bc math module is also required (as we&#8217;re dealing with large numbers, you can check if you have the module in phpinfo).</em></p>


<p>Related posts:<ol><li><a href='http://beaver6813.com/2010/04/php-search-and-replace-directory-recursively/' rel='bookmark' title='Permanent Link: PHP Search and Replace Directory Recursively'>PHP Search and Replace Directory Recursively</a></li>
<li><a href='http://beaver6813.com/2010/05/decor-scene/' rel='bookmark' title='Permanent Link: Decor Scene'>Decor Scene</a></li>
<li><a href='http://beaver6813.com/2010/03/jokepants/' rel='bookmark' title='Permanent Link: Jokepants'>Jokepants</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://beaver6813.com/2009/10/php-get-current-time-in-milliseconds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
