<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://imanpage.com"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Iman&#039;s Page - Function</title>
 <link>http://imanpage.com/taxonomy/term/31/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Convert Linux/Unix timestamp to human readable format in PHP</title>
 <link>http://imanpage.com/code/convert-linuxunix-timestamp-human-readable-format-php</link>
 <description>&lt;p&gt;This functin will help to convert the Linux/Unix timestamp to human readable format:&lt;/p&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;div class=&quot;bash geshifilter-bash&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; unix_timestamp_to_human &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$format&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;D d M Y - H:i:s&#039;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;empty&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;!&lt;/span&gt; is_numeric&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;time&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; ? &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$format&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$format&lt;/span&gt;, &lt;span style=&quot;color: #007800;&quot;&gt;$timestamp&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #007800;&quot;&gt;$unix_time&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;1251208071&amp;quot;&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;echo&lt;/span&gt; unix_timestamp_to_human&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$unix_time&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;//&lt;/span&gt;Return: Tue &lt;span style=&quot;color: #000000;&quot;&gt;25&lt;/span&gt; Aug &lt;span style=&quot;color: #000000;&quot;&gt;2009&lt;/span&gt; - &lt;span style=&quot;color: #000000;&quot;&gt;14&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;47&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;51&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;</description>
 <comments>http://imanpage.com/code/convert-linuxunix-timestamp-human-readable-format-php#comments</comments>
 <category domain="http://imanpage.com/code/code">Code</category>
 <category domain="http://imanpage.com/code/date">Date</category>
 <category domain="http://imanpage.com/code/function">Function</category>
 <category domain="http://imanpage.com/code/human">Human</category>
 <category domain="http://imanpage.com/code/php">PHP</category>
 <category domain="http://imanpage.com/code/time">Time</category>
 <category domain="http://imanpage.com/code/timestamp">Timestamp</category>
 <category domain="http://imanpage.com/code/unix">Unix</category>
 <category domain="http://imanpage.com/code/linux">Linux</category>
 <pubDate>Tue, 25 Aug 2009 17:07:32 +0000</pubDate>
 <dc:creator>Iman</dc:creator>
 <guid isPermaLink="false">27 at http://imanpage.com</guid>
</item>
</channel>
</rss>


