<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Negative timestamps]]></title>
		<link>https://punbb.informer.com/forums/topic/11087/negative-timestamps/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/11087/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Negative timestamps.]]></description>
		<lastBuildDate>Sun, 02 Apr 2006 05:06:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Negative timestamps]]></title>
			<link>https://punbb.informer.com/forums/post/65755/#p65755</link>
			<description><![CDATA[<div class="quotebox"><cite>Connorhd wrote:</cite><blockquote><p>Hmm, sorry i don&#039;t really have any ideas</p><p>Looking at the php.net page again though, other people have<br /></p><div class="codebox"><pre><code>function safestrtotime ($s) {
       $basetime = 0;
       if (preg_match (&quot;/19(\d\d)/&quot;, $s, $m) &amp;&amp; ($m[1] &lt; 70)) {
               $s = preg_replace (&quot;/19\d\d/&quot;, 1900 + $m[1]+68, $s);
               $basetime = 0x80000000 + 1570448;
       }
       return $basetime + strtotime ($s);
}</code></pre></div><p>theres some other alternatives on there too <a href="http://uk2.php.net/strtotime">http://uk2.php.net/strtotime</a> (just search the page for negative)</p></blockquote></div><p>Thanks, I&#039;ll try that.</p>]]></description>
			<author><![CDATA[null@example.com (Mastodon)]]></author>
			<pubDate>Sun, 02 Apr 2006 05:06:17 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/65755/#p65755</guid>
		</item>
		<item>
			<title><![CDATA[Re: Negative timestamps]]></title>
			<link>https://punbb.informer.com/forums/post/65725/#p65725</link>
			<description><![CDATA[<p>Hmm, sorry i don&#039;t really have any ideas</p><p>Looking at the php.net page again though, other people have<br /></p><div class="codebox"><pre><code>function safestrtotime ($s) {
       $basetime = 0;
       if (preg_match (&quot;/19(\d\d)/&quot;, $s, $m) &amp;&amp; ($m[1] &lt; 70)) {
               $s = preg_replace (&quot;/19\d\d/&quot;, 1900 + $m[1]+68, $s);
               $basetime = 0x80000000 + 1570448;
       }
       return $basetime + strtotime ($s);
}</code></pre></div><p>theres some other alternatives on there too <a href="http://uk2.php.net/strtotime">http://uk2.php.net/strtotime</a> (just search the page for negative)</p>]]></description>
			<author><![CDATA[null@example.com (Connorhd)]]></author>
			<pubDate>Sat, 01 Apr 2006 14:15:48 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/65725/#p65725</guid>
		</item>
		<item>
			<title><![CDATA[Re: Negative timestamps]]></title>
			<link>https://punbb.informer.com/forums/post/65721/#p65721</link>
			<description><![CDATA[<p>Thanks, Connorhd. The fact that functions could take negative stamps in input but not output was confusing me.</p><p>Moving on... is there a simple way to work with dates without using timestamps?</p>]]></description>
			<author><![CDATA[null@example.com (Mastodon)]]></author>
			<pubDate>Sat, 01 Apr 2006 11:48:58 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/65721/#p65721</guid>
		</item>
		<item>
			<title><![CDATA[Re: Negative timestamps]]></title>
			<link>https://punbb.informer.com/forums/post/65720/#p65720</link>
			<description><![CDATA[<div class="quotebox"><cite>php.net wrote:</cite><blockquote><p>Note:&nbsp; The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.) Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems. PHP 5.1.0 and newer versions overcome this limitation though.</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (Connorhd)]]></author>
			<pubDate>Sat, 01 Apr 2006 11:09:10 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/65720/#p65720</guid>
		</item>
		<item>
			<title><![CDATA[Negative timestamps]]></title>
			<link>https://punbb.informer.com/forums/post/65714/#p65714</link>
			<description><![CDATA[<p>Is it just me or does PHP disallow negative timestamps (referring to time before the Unix Epoch) in some functions, like strtotime? When I first started running into this problem, I figured it was my host&#039;s PHP installation not allowing negative timestamps whatsoever, but apparently this isn&#039;t the case.</p><p>On my host, this code prints a nicely formatted, correct date :<br /></p><div class="codebox"><pre><code>echo date(&quot;m/d/Y&quot;, -884908800);</code></pre></div><p>But this prints -1 on dates previous to January 1, 1970:<br /></p><div class="codebox"><pre><code>$month = &#039;December&#039;;
$day = 17;
$year = 1941;

echo strtotime($month . &#039; &#039; . $day . &#039;, &#039; . $year);</code></pre></div><p>It&#039;s really annoying me that I can&#039;t work with dates in some functions. What gives?</p><p>PHP 4.4.2</p>]]></description>
			<author><![CDATA[null@example.com (Mastodon)]]></author>
			<pubDate>Sat, 01 Apr 2006 09:29:14 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/65714/#p65714</guid>
		</item>
	</channel>
</rss>
