Re: [PHP] Sniping on the List

2011-11-22 Thread Geoff Shang

Hi,

Apologies if this has moved on, I've not read all my mail from the last 
day and a half.


On Mon, 21 Nov 2011, Tedd Sperling wrote:

Let's consider this -- you are in a different time zone than me, right? 
You said UTC and mine is America New York. As such you claim is that 
your strtotime() function will return a different result for you as 
compared to me because of the time zone differences, right?


Only some of the time.  It depends on the input.

If so, then tell me why I can take both sites (your and mine) and click 
the Submit buttons at the same time and the forms will report back the 
exact same number of elapsed seconds. Try it (you got to be quick):


The timezone affects two things, the input and the output.  If your input 
is absolute and not timezone dependent, both scripts will output the same 
seconds calculation.  But if it is affected by timezone, then the seconds 
count will be different.


Here's an example from a previous message.  The string "1 January 1970 
00:00:00" is timezone dependent, as it is midnight according to the 
particular timezone.


Output from your copy:

String Given: 1 January 1970 00:00:00

Seconds Computed from String: 18000

Output from my copy:

String Given: 1 January 1970 00:00:00

Seconds Computed from String: 0

This is because the number of seconds (aka the Unix Timestamp) is *not* 
affected by timezones - it's the number of seconds since 1 January 1970 
00:00:00 UTC.  This is why it's 0 on my server and 18000 on yours, as 
midnight was 5 hours later in New York.


But if you enter a string like "now", you'll get the current time with the 
same timestamp from both scripts.


String Given: now

Seconds Computed from String: 1322033486

Here's where the output side comes in.  The various date display 
functions will output according to the selected timezone, or the system 
default if none is selected.  So this will display differently on your 
server and on mine.


Lets use the value of 'now' above to demonstrate:

$ php -r 'date_default_timezone_set ("America/New_York"); echo date ("r", 
1322033486);'

Wed, 23 Nov 2011 02:31:26 -0500

php -r 'date_default_timezone_set ("UTC"); echo date ("r", 1322033486);'
Wed, 23 Nov 2011 07:31:26 +

Same input, different output.

Now if you combine these two factors, it explains all the results you see. 
If you use strings like "today" or "1 January 1970 00:00:00", the scripts 
will print the same date (and time if you asked it to), but they aren't 
actually the same, as one is 5 hours behind the other.   But if you use an 
absolute time like "now" or "1 January 1970 00:00:00 +" (which 
specifies the timezone), the scripts will print different times based on 
the timezone.


Now, to the point under debate.  Since values like 0 and null are absolute 
rather than relative, the output will vary depending on which timezone is 
in use.


$ php -r 'date_default_timezone_set ("UTC"); echo date ("r", null);'
Thu, 01 Jan 1970 00:00:00 +

$ php -r 'date_default_timezone_set ("America/New_York"); echo date ("r", 
null);'

Wed, 31 Dec 1969 19:00:00 -0500

Geoff.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-22 Thread Curtis Maurand

On 11/22/2011 7:15 AM, Judson Vaughn wrote:

Isn't Eastern time zone minus 5 not plus 5 hours of GMT?

Jud

It depends upon your point of view. ;-)

It's generally understood that EST5EDT is GMT (UTC) -5 because eastern 
time is 5 hours behind.


+5 puts you in India somewhere.

Cheers,
Curtis


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-22 Thread Judson Vaughn
Isn't Eastern time zone minus 5 not plus 5 hours of GMT? 

Jud

Sent from my iPad
Jud at bizville.com
Phone 703-303-4271

On Nov 21, 2011, at 11:34 PM, Tedd Sperling  wrote:

> Why is that? By what you said, shouldn't the reports be offset (+5 hours) by 
> the local timezone differences?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-21 Thread Tedd Sperling
On Nov 20, 2011, at 4:59 PM, Geoff Shang wrote:

> On Sun, 20 Nov 2011, Tedd Sperling wrote:
> 
>> I appreciate your time and comments. However, you missed the point I was 
>> trying to make, which does not have anything to do with timezones. If you 
>> copy my code and place it on any server in the world, you'll observe the 
>> same results as I did.
> 
> NO I won't, and timezones do matter.
> 
> This server is set to UTC and uses PHP 5.2.6.
> 
> Lets skip right to your point.
> 
> From your script on your server:
> 
> String Given: null
> 
> Seconds Computed from String: null
> 
> Date from Seconds Computed: 31 December, 1969 : Wednesday
> ___
> 
> From the script on my server:
> 
>   String Given: null
> 
>   Seconds Computed from String: null
> 
>   Date from Seconds Computed: 1 January, 1970 : Thursday
> __

Geoff:

Hmmm, granted your output is different than mine. But I think there is 
something else beside timezones going on here, but I could be wrong.

My server is set to America New York (+5 hours) and uses PHP version 5.2.17

Let's consider this -- you are in a different time zone than me, right? You 
said UTC and mine is America New York. As such you claim is that your 
strtotime() function will return a different result for you as compared to me 
because of the time zone differences, right?

If so, then tell me why I can take both sites (your and mine) and click the 
Submit buttons at the same time and the forms will report back the exact same 
number of elapsed seconds. Try it (you got to be quick):

http://www.webbytedd.com//strtotime/index.php
http://quitelikely.com/~geoff/strtotime/index.php

Why is that? By what you said, shouldn't the reports be offset (+5 hours) by 
the local timezone differences?

What am I not understanding here?

Cheers,

tedd


_
t...@sperling.com
http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-20 Thread Geoff Shang

On Sun, 20 Nov 2011, Tedd Sperling wrote:

I appreciate your time and comments. However, you missed the point I was 
trying to make, which does not have anything to do with timezones. If 
you copy my code and place it on any server in the world, you'll observe 
the same results as I did.


NO I won't, and timezones do matter.

I've copied your code to http://quitelikely.com/~geoff/strtotime/

Sorry if any of the visuals are mangled, I had to massage the script a 
little to pullin the header and footer, and I downloaded your logo, but I 
didn't go and dig out your CSS or javascript.


This server is set to UTC and uses PHP 5.2.6.

Lets skip right to your point.


From your script on your server:


String Given: null

Seconds Computed from String: null

Date from Seconds Computed: 31 December, 1969 : Wednesday
___


From the script on my server:


   String Given: null

   Seconds Computed from String: null

   Date from Seconds Computed: 1 January, 1970 : Thursday
 __


You touched on my point with:

You'll also notice that the value of seconds computed from string is 
blank (i.e. not 0).  This is because strtotime() doesn't know what to 
do with a value of '0'.  Whether it should or not is probably a 
phillosophical debate.


But you did not contribute to which side of the debate would you side.


I didn't, because the debate was on whether or not NULL == Wednesday, not 
whether or not strtotime("0") should return 0.  I agree there's a good 
case for it doing so, you could file a bug if you feel strongly about it.


My prior opinion was that 0 should return 'Jan 1, 1970'. However, Stuart 
pointed out a flaw in my code.  You see, I was assuming that using the 
return from strtotime(0) in the getdate() function would return the 
correct date, but this was a cascade error.


As I think I mentioned before, using strtotime at all is the problem, as 
we are talking about null as a concept, not "null" the alphabetical 
string.  Since null is nominally a numerical value, we can pass it 
directly as a timestamp.


php -r 'echo date("r", null);'
Thu, 01 Jan 1970 00:00:00 +

Geoff.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-20 Thread Tedd Sperling
On Nov 20, 2011, at 4:00 PM, Geoff Shang wrote:
> On Sat, 19 Nov 2011, Tedd Sperling wrote:
> 
>> Now, where are my observations wrong? The code is shown in the demo.
> 
> To summarise, your observations are wrong because they do not take timezone 
> into account and do not show the time, only the date.  And some of your 
> observations as given above do not match what your script outputs.
> 
> Geoff.
> 

Geof:

I appreciate your time and comments. However, you missed the point I was trying 
to make, which does not have anything to do with timezones. If you copy my code 
and place it on any server in the world, you'll observe the same results as I 
did.

You touched on my point with:

> You'll also notice that the value of seconds computed from string is blank 
> (i.e. not 0).  This is because strtotime() doesn't know what to do with a 
> value of '0'.  Whether it should or not is probably a phillosophical debate.

But you did not contribute to which side of the debate would you side.

My prior opinion was that 0 should return 'Jan 1, 1970'. However, Stuart 
pointed out a flaw in my code.  You see, I was assuming that using the return 
from strtotime(0) in the getdate() function would return the correct date, but 
this was a cascade error.

I have not investigated this further.

Cheers,

tedd

_
t...@sperling.com
http://sperling.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-20 Thread Geoff Shang

On Sat, 19 Nov 2011, Tedd Sperling wrote:


My observations are demonstrated here:

http://www.webbytedd.com//strtotime/index.php


this code would IMHO be more useful if it also displayed time, not just 
date.  It's also not clear what timezone you're using, as it's not set as 
far as I can see.


Please note that regardless of time zone, the strtotime() function works 
(or at least it does for me) such that:


If you enter '-1', the function will report back Todays Date with 
current seconds. Note there is no difference between entering 'Today' or 
'-1'.


This is not what your code shows.

String Given: -1

Seconds Computed from String: 1321805103

Date from Seconds Computed: 20 November, 2011 : Sunday

___

Current Time (seconds): 1321819503

Current Date: 20 November, 2011 : Sunday

This is a difference of 14400 seconds or 4 hours.

String Given: today

Seconds Computed from String: 1321765200

Date from Seconds Computed: 20 November, 2011 : Sunday

___

Current Time (seconds): 1321819877

Current Date: 20 November, 2011 : Sunday

This is a much larger difference.  'today' is meant to return the same as 
'today 00:00:00'.  I  know it used not to, it was a PHP bug awhile back... 
which begs the question, which PHP version are you using?



If you enter '0', the function will report back December, 31, 1969.


You'll also notice that the value of seconds computed from string is 
blank (i.e. not 0).  This is because strtotime() doesn't know what to do 
with a value of '0'.  Whether it should or not is probably a 
phillosophical debate.



If you enter nothing (i.e., null), then it reports back December, 31, 1969.


It does, but we dont' know exactly when this is because your script 
doesn't show time.  It could be actually returning a 0 timestamp.


We can force your script to show us what 0 time is according to its 
timezone by entering an absolute date including UTC offset.


String Given: 1 January 1970 +

Seconds Computed from String: 0

Date from Seconds Computed: 31 December, 1969 : Wednesday

___

So your script shows 31/12/1969 for the epoch, so we dont' know if the 
null value is the epoch or before.


To further prove my point, witness the number of seconds calculated from 1 
January 1970 in your script's timezone:


String Given: 1 January 1970

Seconds Computed from String: 18000

Date from Seconds Computed: 1 January, 1970 : Thursday

___

This means your script is using a timezone of UTC -0500 (US Eastern).  So 
any time within the first 5 hours of the epoch will show as being in 1969.


To avoid this, explicitly set your script to use UTC.  Or use US Eastern 
but be up front about the fact that your'e doing this.



It's clear (and by definition) that unix zero time (i.e., 00:00:00) happened in 
1970.

It's also clear that time before unix zero happened before 1970 (i.e., 
'December 31, 1969').

As such, null (and not the string 'null' as stated my someone else, duh) should come back as 
"undefined" OR "December, 31, 1969".


It doesn't for me, using either PHP 5.2.6 or 5.3.3.

php -r 'echo date ("r", strtotime (""));'
Thu, 01 Jan 1970 00:00:00 +


Furthermore, the string '-1' should default to '-1 second' instead of being the 
same as if I entered 'Today'.


Apart from the fact that for me at least, strtotime ("today") returns 
today at midnight, whereas strtotime ("-1") seems to return something else 
(time() + 3600 on boxes set to UTC, time() + 10800 on my box set to local 
time in Israel), strtotime is meant to turn textual representations of 
time into a unix timestamp.  Surely the meaning of "-1" is at the very 
least ambiguous, and the fact that it returns anything is surprising.



Now, where are my observations wrong? The code is shown in the demo.


To summarise, your observations are wrong because they do not take 
timezone into account and do not show the time, only the date.  And some 
of your observations as given above do not match what your script outputs.


Geoff.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-19 Thread Tedd Sperling
On Nov 19, 2011, at 11:59 AM, Stuart Dallas wrote:
> On 19 Nov 2011, at 16:48, Tedd Sperling wrote:
>> For example, if you push '-1' though strtotime(-1), you'll get Wednesday 
>> only one day a week -- whereas 'null' works every time.
> Technically I see that as a bug. I believe strtotime(null) should return 
> null, but due to the way type inference works, null is interpreted as 0. 
> The point here being that you're not getting the time at null, you're 
> getting the time at 0.
 
 Nope, zero time is absolutely January 1, 1970 00:00:00 -- which was a 
 Thursday. If you pass zero through strtotime(), it reports "December 1969" 
 and I claim that to be a bug. Realize that seconds, minutes, and hours go 
 from 0-59, not 1 to 60. Any fractions of a second before zero was 
 59.999... and such was indeed part of the day/month/year before.
>>> 
>>> That has nothing to do with seconds running from 0 to 59 rather than 1 to 
>>> 60, it has to do with your timezone. When you ask PHP to display a 
>>> formatted date with a timestamp of 0 you're actually getting the time at 
>>> (unix timestamp 0 + (3600 * your timezone offset in hours)). Since you're 
>>> in a timezone that's behind UTC you get the previous day.
>> 
>>> -snip- with other time zone discussion that have nothing to do with what I 
>>> observed nor addressed in my post.
>> 
>> My observations are demonstrated here:
>> 
>> http://www.webbytedd.com//strtotime/index.php
> 
> Your test code is flawed because strtotime returns an error when you pass it 
> null. Your code is passing that false to getdate, which is interpreting it as 
> an integer, which would be 0.
> 
> -Stuart

Interesting -- I shall look into it.

Thanks,

tedd


_
t...@sperling.com
http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-19 Thread Stuart Dallas

On 19 Nov 2011, at 16:48, Tedd Sperling wrote:
> For example, if you push '-1' though strtotime(-1), you'll get Wednesday 
> only one day a week -- whereas 'null' works every time.
 Technically I see that as a bug. I believe strtotime(null) should return 
 null, but due to the way type inference works, null is interpreted as 0. 
 The point here being that you're not getting the time at null, you're 
 getting the time at 0.
>>> 
>>> Nope, zero time is absolutely January 1, 1970 00:00:00 -- which was a 
>>> Thursday. If you pass zero through strtotime(), it reports "December 1969" 
>>> and I claim that to be a bug. Realize that seconds, minutes, and hours go 
>>> from 0-59, not 1 to 60. Any fractions of a second before zero was 59.999... 
>>> and such was indeed part of the day/month/year before.
>> 
>> That has nothing to do with seconds running from 0 to 59 rather than 1 to 
>> 60, it has to do with your timezone. When you ask PHP to display a formatted 
>> date with a timestamp of 0 you're actually getting the time at (unix 
>> timestamp 0 + (3600 * your timezone offset in hours)). Since you're in a 
>> timezone that's behind UTC you get the previous day.
> 
>> -snip- with other time zone discussion that have nothing to do with what I 
>> observed nor addressed in my post.
> 
> My observations are demonstrated here:
> 
> http://www.webbytedd.com//strtotime/index.php

Your test code is flawed because strtotime returns an error when you pass it 
null. Your code is passing that false to getdate, which is interpreting it as 
an integer, which would be 0.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-19 Thread Tedd Sperling
On Nov 18, 2011, at 12:40 AM, Robert Cummings wrote:
> By you're reasoning since I did not exist before 1974 then time itself could 
> not possibly have existed before then either since I was not in existence to 
> perceive it. That's as ludicrous as suggesting time did not exist before the 
> big bang (presuming this model is correct).  Also, them's some fancy shmancy 
> words you're slinging about up there, but without a proof it's just farts in 
> the wind :) No more valid than a theory of creation or the big ass spaghetti 
> thingy majingy dude. Folded shmeality and phases of whatsyamacallit may well 
> be true, but provability of the non-existence of time before the big bang 
> theory is not provable by this model. However, what is valid is to take a 
> point of reference in time and infer a period before it. Thus before the big 
> bang is perfectly valid whether we could perceive it or not.
> 
> Cheers,
> Rob.

Again, you have shown an uncanny insight into the way things are.  :-)

Cheers,

tedd

_
t...@sperling.com
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-19 Thread Tedd Sperling
On Nov 17, 2011, at 7:59 PM, Stuart Dallas wrote:
> On 17 Nov 2011, at 20:17, Tedd Sperling wrote:
>> On Nov 17, 2011, at 11:58 AM, Stuart Dallas wrote:
>>> "defined as the number of seconds elapsed since midnight Coordinated 
>>> Universal Time (UTC) of Thursday, January 1, 1970 (Unix times are defined, 
>>> but negative, before that date)" [http://en.wikipedia.org/wiki/Unix_time]
>> 
>> Good reference to support your point, but strtotime() doesn't qork that way. 
>>  In addition, the statement does not address where the fractions of a second 
>> were that occurred before the completion of the first second, clearly those 
>> fractions occurred in 1970.
> 
> It certainly does address that. The definition "the number of seconds 
> elapsed" says nothing about whole seconds, so I'd venture that fractions of a 
> second are still covered.

Good -- I'm glad we agree.

 For example, if you push '-1' though strtotime(-1), you'll get Wednesday 
 only one day a week -- whereas 'null' works every time.
>>> Technically I see that as a bug. I believe strtotime(null) should return 
>>> null, but due to the way type inference works, null is interpreted as 0. 
>>> The point here being that you're not getting the time at null, you're 
>>> getting the time at 0.
>> 
>> Nope, zero time is absolutely January 1, 1970 00:00:00 -- which was a 
>> Thursday. If you pass zero through strtotime(), it reports "December 1969" 
>> and I claim that to be a bug. Realize that seconds, minutes, and hours go 
>> from 0-59, not 1 to 60. Any fractions of a second before zero was 59.999... 
>> and such was indeed part of the day/month/year before.
> 
> That has nothing to do with seconds running from 0 to 59 rather than 1 to 60, 
> it has to do with your timezone. When you ask PHP to display a formatted date 
> with a timestamp of 0 you're actually getting the time at (unix timestamp 0 + 
> (3600 * your timezone offset in hours)). Since you're in a timezone that's 
> behind UTC you get the previous day.

> -snip- with other time zone discussion that have nothing to do with what I 
> observed nor addressed in my post.

My observations are demonstrated here:

http://www.webbytedd.com//strtotime/index.php

Please note that regardless of time zone, the strtotime() function works (or at 
least it does for me) such that:

If you enter '-1', the function will report back Todays Date with current 
seconds. Note there is no difference between entering 'Today' or '-1'.
If you enter '0', the function will report back December, 31, 1969.
If you enter nothing (i.e., null), then it reports back December, 31, 1969.

It's clear (and by definition) that unix zero time (i.e., 00:00:00) happened in 
1970.

It's also clear that time before unix zero happened before 1970 (i.e., 
'December 31, 1969').

As such, null (and not the string 'null' as stated my someone else, duh) should 
come back as "undefined" OR "December, 31, 1969".

Furthermore, the string '-1' should default to '-1 second' instead of being the 
same as if I entered 'Today'.

Now, where are my observations wrong? The code is shown in the demo.

Cheers,

tedd


_
t...@sperling.com
http://sperling.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-19 Thread Robert Cummings

On 11-11-19 03:14 AM, Lester Caine wrote:

Robert Cummings wrote:

It's Friday... traditionally content anal-ness has been somewhat disregarded on
this day. Need one go through the archives to see if you're being a tad
hypocritical?


Although it only seems to be this latest thread that seems to have got totally
OTT even for a Friday. And I think 'Friday Distraction' is a fairly recent
development that was never every Friday ...
I have the archive since 2004 on-line here and it sort of started on 09, but
there were only a few each year - usually over the summer? And most of them were
realistic tangential discussions rather than totally anal.
Personally, this last one has become irritating and obviously others find the
same thing?


I don't know... I haven't heard from many on the list and there seems to 
be as many responding as wishing it would stop. That said, why re-hash 
it on a Saturday (or as the case may be... so close to Saturday). Were 
you hoping to continue it over the weekend? Also, you say it seems to 
have started around 2009... that's almost 3 years. I consider that a 
fairly long standing trend and not quite as "recent" as you make it 
sound. I've been on this list in one form or another since 2000... I'd 
say for the most part these kinds of conversations crop up with fair 
regularity. I'm not saying every day, but often enough that I don't 
understand the sudden whining-- and as I've also pointed out, there's 
likely a degree of hypocrisy afoot. Either way, I'm done with the 
thread, enjoy your weekend.


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-19 Thread Lester Caine

Robert Cummings wrote:

It's Friday... traditionally content anal-ness has been somewhat disregarded on
this day. Need one go through the archives to see if you're being a tad
hypocritical?


Although it only seems to be this latest thread that seems to have got totally 
OTT even for a Friday. And I think 'Friday Distraction' is a fairly recent 
development that was never every Friday ...
I have the archive since 2004 on-line here and it sort of started on 09, but 
there were only a few each year - usually over the summer? And most of them were 
realistic tangential discussions rather than totally anal.
Personally, this last one has become irritating and obviously others find the 
same thing?


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-18 Thread Robert Cummings

On 11-11-18 10:03 AM, Curtis Maurand wrote:



Robert Cummings wrote:
Robert Cummings wrote:




Given the discussion, I think the following is in order: BAZINGA * 2

  And what does any of this have to do with PHP?  It's time to
end this thread.


It's Friday... traditionally content anal-ness has been somewhat 
disregarded on this day. Need one go through the archives to see if 
you're being a tad hypocritical?


Cheese,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re: [PHP] Sniping on the List

2011-11-18 Thread Fredric L. Rice
rc> Thus before the big bang is perfectly
rc> valid whether we could perceive it or not.
ts> Not really. It's as meaningless as asking
ts> what's north of the North Pole.

That's an interesting point. If you stand at the North Pole where all
lines of reference converge, there is still Galactic North and True North
if one's reference frame is Magnetic North. There are no privelaged frames
of references UNLESS there is only ONE singular frame of reference.

The Big Bang is a singularity event, there were no reference points in
existance until the Big Bang, ergo you're so right, even saying "before
the Big Bang" isn't even wrong. :)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-18 Thread Fredric L. Rice
rc> However, what is valid is to take a point of
rc> reference in time and infer a period before
rc> it. Thus before the big bang is perfectly valid
rc> whether we could perceive it or not.

It's a question of asking what existed before anything existed, though.
The answer is not even "nothing" since nothing is something.

There's also something bizarre and ironic in having Unix and Windows-based
epoc sidereal time firmly rooted in a non-event that didn't happen over 41
years ago. The irony is that Unix epoc time wraps the supposed Mithratic
Jesus birth date which also didn't happen, our computers are delusional
but also logical -- amusing.

This whole PHP thing about epoc time is amusing since there remains the
question of what frame of reference the first second of Unix time is
predicated upon. January 1st 1970 has no reality, it was never real, it
was an abritrary symbol etched in to Unix to reference how many vibrations
of an atom excited by a cessium rubidium maser in Goldstone, Colorado
there has been since an arbitrary frame of reference.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-18 Thread Fredric L. Rice
>> It's another nail in the coffin of deity constructors.
> Not even slightly.

Totally since deity constructors only started to exist after the second
generation of stars formed since the advent of hadronic life.

> But none of this has anything even vaguely related to PHP.

Sure it does, the origins of the universe for Linux is January 1st, 1970,
just as it is for PHP epoc time. Time for Unix didn't exist prior to that
since there was no prior. People who *think* they were born before 1970
are mistaken.

To further prove my point, try searching for any reference to PHP prior to
January 1st, 1970. It does not exist.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-18 Thread Curtis Maurand


Robert Cummings wrote:
Robert Cummings wrote:
> 
>
Given the discussion, I think the following is in order: BAZINGA * 2

 And what does any of this have to do with PHP?  It's time to
end this thread.

--Curtis


Re: [PHP] Sniping on the List

2011-11-18 Thread Robert Cummings

On 11-11-18 05:15 AM, Tim Streater wrote:

On 18 Nov 2011 at 05:40, Robert Cummings  wrote:


without a proof it's just farts in the wind :) No more valid than a
theory of creation or the big ass spaghetti thingy majingy dude. Folded


The "theory" of creation is not a theory. It's a hypothesis, as is "scientific 
creationism".


From Merriam-Webster's online dictionary:

Hypothesis - Synonyms: theory, proposition, supposition, thesis

http://www.merriam-webster.com/dictionary/hypothesis


Thus before the big bang
is perfectly valid whether we could perceive it or not.


Not really. It's as meaningless as asking what's north of the North Pole.


No, this is a false analogy. Again from Merriam-Webster:

north pole: the northernmost point of the earth

As such, by definition there can be no further north than the north 
pole. No such equivalent exists for the big bang event. Beginning of the 
universe? YES. Beginning of time? NO!


Given the discussion, I think the following is in order: BAZINGA * 2

Thank you, I won't be here all day!

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Sniping on the List

2011-11-18 Thread Steven Staples
> -Original Message-
> From: Fredric L. Rice [mailto:fr...@sonic.net]
> Sent: November 17, 2011 6:25 PM
> To: Stuart Dallas
> Cc: Tedd Sperling; PHP List
> Subject: Re: [PHP] Sniping on the List
> 
> >> Consider this -- do you think the second before
> >> the "Big Bang" was negative or null?
> > I don't know. There's no point concerning ourselves
> > with unanswerable questions.
> 
> The question itself is a logical absurdity since there was no time prior
> to the Big Bang. The advent of time began when the dimention we perceive
> as the passage of time froze out of folded reality during the expansion
> phases's symmertry breaking period, there is not only no answer to what
> happened before, even suggesting there *was* a before is not possible.
> 
> It's another nail in the coffin of deity constructors.

And here I thought that "The Big Bang Theory" was a funny sitcom?  Damn...
where have I been all this time?   Maybe since I wasn't around to witness it
happening, it didn't really happen, and this is just my own reality, that
you guys happen to be a part of, in my subconscious?

Besides, are we not just all part of "The Matrix" ?   (what's even more
funny, is that I drive a Toyota Matrix... WEIRD)

Steven Staples
Web Application Programmer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re: [PHP] Sniping on the List

2011-11-18 Thread Tim Streater
On 18 Nov 2011 at 05:40, Robert Cummings  wrote: 

> without a proof it's just farts in the wind :) No more valid than a
> theory of creation or the big ass spaghetti thingy majingy dude. Folded

The "theory" of creation is not a theory. It's a hypothesis, as is "scientific 
creationism".

> Thus before the big bang
> is perfectly valid whether we could perceive it or not.

Not really. It's as meaningless as asking what's north of the North Pole.

--
Cheers  --  Tim

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sniping on the List

2011-11-18 Thread Tommy Pham
On Thu, Nov 17, 2011 at 9:43 PM, Robert Cummings  wrote:
>    http://shorl.com/tebrakefesahe
>

ROFLMAO!!!  Thanks Robert for starting off a good Friday for me :D

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Robert Cummings

On 11-11-18 12:40 AM, Robert Cummings wrote:

On 11-11-17 06:24 PM, Fredric L. Rice wrote:

Consider this -- do you think the second before
the "Big Bang" was negative or null?

I don't know. There's no point concerning ourselves
with unanswerable questions.


The question itself is a logical absurdity since there was no time prior
to the Big Bang. The advent of time began when the dimention we perceive
as the passage of time froze out of folded reality during the expansion
phases's symmertry breaking period, there is not only no answer to what
happened before, even suggesting there *was* a before is not possible.

It's another nail in the coffin of deity constructors.


By you're reasoning since I did not exist before 1974 then time itself
could not possibly have existed before then either since I was not in
existence to perceive it. That's as ludicrous as suggesting time did not
exist before the big bang (presuming this model is correct).  Also,
them's some fancy shmancy words you're slinging about up there, but
without a proof it's just farts in the wind :) No more valid than a
theory of creation or the big ass spaghetti thingy majingy dude. Folded
shmeality and phases of whatsyamacallit may well be true, but
provability of the non-existence of time before the big bang theory is
not provable by this model. However, what is valid is to take a point of
reference in time and infer a period before it. Thus before the big bang
is perfectly valid whether we could perceive it or not.


The following pretty much sums up the entire argument:

http://shorl.com/tebrakefesahe

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Robert Cummings

On 11-11-17 06:24 PM, Fredric L. Rice wrote:

Consider this -- do you think the second before
the "Big Bang" was negative or null?

I don't know. There's no point concerning ourselves
with unanswerable questions.


The question itself is a logical absurdity since there was no time prior
to the Big Bang. The advent of time began when the dimention we perceive
as the passage of time froze out of folded reality during the expansion
phases's symmertry breaking period, there is not only no answer to what
happened before, even suggesting there *was* a before is not possible.

It's another nail in the coffin of deity constructors.


By you're reasoning since I did not exist before 1974 then time itself 
could not possibly have existed before then either since I was not in 
existence to perceive it. That's as ludicrous as suggesting time did not 
exist before the big bang (presuming this model is correct).  Also, 
them's some fancy shmancy words you're slinging about up there, but 
without a proof it's just farts in the wind :) No more valid than a 
theory of creation or the big ass spaghetti thingy majingy dude. Folded 
shmeality and phases of whatsyamacallit may well be true, but 
provability of the non-existence of time before the big bang theory is 
not provable by this model. However, what is valid is to take a point of 
reference in time and infer a period before it. Thus before the big bang 
is perfectly valid whether we could perceive it or not.


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Stuart Dallas
On 17 Nov 2011, at 20:17, Tedd Sperling wrote:
> On Nov 17, 2011, at 11:58 AM, Stuart Dallas wrote:
>> The epoch specifies the exact time that 0 represents. It makes no claims as 
>> far as that being the start of anything...
>> 
>> "defined as the number of seconds elapsed since midnight Coordinated 
>> Universal Time (UTC) of Thursday, January 1, 1970 (Unix times are defined, 
>> but negative, before that date)" [http://en.wikipedia.org/wiki/Unix_time]
> 
> Good reference to support your point, but strtotime() doesn't qork that way.  
> In addition, the statement does not address where the fractions of a second 
> were that occurred before the completion of the first second, clearly those 
> fractions occurred in 1970.

It certainly does address that. The definition "the number of seconds elapsed" 
says nothing about whole seconds, so I'd venture that fractions of a second are 
still covered.

>>> For example, if you push '-1' though strtotime(-1), you'll get Wednesday 
>>> only one day a week -- whereas 'null' works every time.
>> Technically I see that as a bug. I believe strtotime(null) should return 
>> null, but due to the way type inference works, null is interpreted as 0. The 
>> point here being that you're not getting the time at null, you're getting 
>> the time at 0.
> 
> Nope, zero time is absolutely January 1, 1970 00:00:00 -- which was a 
> Thursday. If you pass zero through strtotime(), it reports "December 1969" 
> and I claim that to be a bug. Realize that seconds, minutes, and hours go 
> from 0-59, not 1 to 60. Any fractions of a second before zero was 59.999... 
> and such was indeed part of the day/month/year before.

That has nothing to do with seconds running from 0 to 59 rather than 1 to 60, 
it has to do with your timezone. When you ask PHP to display a formatted date 
with a timestamp of 0 you're actually getting the time at (unix timestamp 0 + 
(3600 * your timezone offset in hours)). Since you're in a timezone that's 
behind UTC you get the previous day.

What would you expect "0" as the specification of either an absolute or 
relative time string to represent? Now, or the unix timestamp 0? Me, I'd call 
it an invalid argument, and PHP 5.3 happens to agree with me...

$ php -r "var_dump(strtotime(0));"
bool(false)

It does that whether the 0 is passed as a string or a number. Seems right to me.

> In addition, passing -1 through strtotime() simply returns today, whereas 
> 'null' returns a date prior to the start of everything and that makes more 
> logical sense to me.

Not on my machine (PHP 5.3). Passing -1 does what I would expect: it takes 1 
second off the current timestamp...

$ php -r "echo date('r', strtotime(-1));"
Fri, 18 Nov 2011 01:40:53 +

And passing null equally does the right thing, which is to return an error...

$ php -r "var_dump(strtotime(null));"
bool(false)

Passing -1 does what I would expect: it takes 1 second off the current 
timestamp...

Geoff is quite right to point out that strtotime is not the best way to test 
whether null is Wednesday, date is a better choice. Let's see what we get on 
5.3. As expected, 0 == the epoch...

$ php -r "date_default_timezone_set('UTC'); echo date('r', 0);"
Thu, 01 Jan 1970 00:00:00 +

And -1 == 1 second before the epoch...

$ php -r "date_default_timezone_set('UTC'); echo date('r', -1);"
Wed, 31 Dec 1969 23:59:59 +

And null...

$ php -r "date_default_timezone_set('UTC'); echo date('r', null);"
Thu, 01 Jan 1970 00:00:00 +

So null is (well, was) a Thursday in UTC. It was a Wednesday on the west coast 
of the US...

$ php -r "date_default_timezone_set('America/Los_Angeles'); echo date('r', 
null);"
Wed, 31 Dec 1969 16:00:00 -0800

...but I'm not in the US and it's not BST!

Since it's now Friday where I am, time for a quick plug of the app I've been 
involved with for a few years now, and which finally had a public launch this 
week: http://datasift.com/. Lovely.

TTFN :)

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread George Langley
> 
>> It's another nail in the coffin of deity constructors.
-
And just as this thread was getting boringly OT! ;-{)]


George Langley
Interactive Developer

www.georgelangley.ca



Re: [PHP] Sniping on the List

2011-11-17 Thread Stuart Dallas
On 17 Nov 2011, at 23:24, Fredric L. Rice wrote:

>>> Consider this -- do you think the second before
>>> the "Big Bang" was negative or null?
>> I don't know. There's no point concerning ourselves
>> with unanswerable questions.
> 
> The question itself is a logical absurdity since there was no time prior
> to the Big Bang. The advent of time began when the dimention we perceive
> as the passage of time froze out of folded reality during the expansion
> phases's symmertry breaking period, there is not only no answer to what
> happened before, even suggesting there *was* a before is not possible.

Therefore suggesting that time did not exist "before" is as daft as suggesting 
that the edges of the universe are being pulled away from us by a herd of randy 
sloths. The big bang theory is based on an analysis of the effects we can 
observe in the here and now, which is nowhere near proof that it's actually 
what happened. Especially not when you consider that the only thing I (or you) 
actually know is that I (or you) exist in some form, and everything else is a 
guess based on incredibly flimsy evidence!

> It's another nail in the coffin of deity constructors.

Not even slightly.

But none of this has anything even vaguely related to PHP.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Fredric L. Rice
>> Consider this -- do you think the second before
>> the "Big Bang" was negative or null?
> I don't know. There's no point concerning ourselves
> with unanswerable questions.

The question itself is a logical absurdity since there was no time prior
to the Big Bang. The advent of time began when the dimention we perceive
as the passage of time froze out of folded reality during the expansion
phases's symmertry breaking period, there is not only no answer to what
happened before, even suggesting there *was* a before is not possible.

It's another nail in the coffin of deity constructors.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Sniping on the List

2011-11-17 Thread Fredric L. Rice
> What if we were to throw in quantum duality in here?
> Null and !Null at the same time

Please no, our company is trying to outsource to India and they're
constantly trying to shove things through narrow slits and the effect has
been costly.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Geoff Shang

On Thu, 17 Nov 2011, Tedd Sperling wrote:


On Nov 17, 2011, at 11:58 AM, Stuart Dallas wrote:

The epoch specifies the exact time that 0 represents. It makes no claims as far 
as that being the start of anything...

"defined as the number of seconds elapsed since midnight Coordinated Universal Time 
(UTC) of Thursday, January 1, 1970 (Unix times are defined, but negative, before that 
date)" [http://en.wikipedia.org/wiki/Unix_time]


Good reference to support your point, but strtotime() doesn't qork that way.


Yes it does.

$ php -r 'echo strtotime ("31 Dec 1969 23:59 +");'
-60


For example, if you push '-1' though strtotime(-1), you'll get Wednesday only 
one day a week -- whereas 'null' works every time.

Technically I see that as a bug. I believe strtotime(null) should return null, 
but due to the way type inference works, null is interpreted as 0. The point 
here being that you're not getting the time at null, you're getting the time at 
0.



Nope, zero time is absolutely January 1, 1970 00:00:00 -- which was a 
Thursday. If you pass zero through strtotime(), it reports "December 
1969" and I claim that to be a bug.


Not here it doesn't.

$ php -r 'echo date ("r", strtotime ("zero"));'
Thu, 01 Jan 1970 00:00:00 +

But it might for you (see below).


In addition, passing -1 through strtotime() simply returns today,


Here it returns a time an hour later than now.

$ date -R; php -r 'echo date ("r", strtotime ("-1"));'
Thu, 17 Nov 2011 20:41:06 +
Thu, 17 Nov 2011 21:41:07 +

whereas 'null' returns a date prior to the start of everything and that 
makes more logical sense to me.


but here we hit the crux of the problem.  'strtotime("null")' isn't 
returning a null timestamp, it's simply returning the value for an 
inability to convert the string "null" to a timestamp.


Of course, now that I try to reproduce the "null == Wednesday" result, I 
find that I can't.  Everything comes up as Thu, 01 Jan 1970 00:00:00 + 
which probably invalidates much of what I've written above.  Maybe I'm not 
running a new enough PHP (latest I have access to is 5.3.3).  But if this 
is the case, this suggests this behaviour changed relatively recently.


Anyway, as I was going to say, the correct way to find out what null is is 
to do something like:


echo date ("r", null);

But this thread has gone through so many twists now that I can't remember 
if this is where we began or not.


Geoff.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Tedd Sperling
On Nov 17, 2011, at 11:58 AM, Stuart Dallas wrote:
> The epoch specifies the exact time that 0 represents. It makes no claims as 
> far as that being the start of anything...
> 
> "defined as the number of seconds elapsed since midnight Coordinated 
> Universal Time (UTC) of Thursday, January 1, 1970 (Unix times are defined, 
> but negative, before that date)" [http://en.wikipedia.org/wiki/Unix_time]

Good reference to support your point, but strtotime() doesn't qork that way.  
In addition, the statement does not address where the fractions of a second 
were that occurred before the completion of the first second, clearly those 
fractions occurred in 1970.

>> For example, if you push '-1' though strtotime(-1), you'll get Wednesday 
>> only one day a week -- whereas 'null' works every time.
> Technically I see that as a bug. I believe strtotime(null) should return 
> null, but due to the way type inference works, null is interpreted as 0. The 
> point here being that you're not getting the time at null, you're getting the 
> time at 0.


Nope, zero time is absolutely January 1, 1970 00:00:00 -- which was a Thursday. 
If you pass zero through strtotime(), it reports "December 1969" and I claim 
that to be a bug. Realize that seconds, minutes, and hours go from 0-59, not 1 
to 60. Any fractions of a second before zero was 59.999... and such was indeed 
part of the day/month/year before.

In addition, passing -1 through strtotime() simply returns today, whereas 
'null' returns a date prior to the start of everything and that makes more 
logical sense to me.

>> My point stands: null == Wednesday.   :-)
> 
> It may stand, but it's standing on foundations of null space :)

Been there many times. :-)

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Tamara Temple



On Nov 17, 2011, at 10:01 AM, Tedd Sperling   
wrote:



On Nov 15, 2011, at 2:54 PM, Steven Staples wrote:

 sent:

 wrote:

PS: I know it's not Friday, but this question came up in class
yesterday and I thought maybe all of you might like to guess why
null is Wednesday?


Wait.. What??

$ php -r 'echo date("l",NULL),"\n";'
Wednesday

Cos:

$ php -r 'echo date("r",NULL),"\n";'
Wed, 31 Dec 1969 18:00:00 -0600

(Personally, I would have thought Thursday should be NULL, but  
that's

just me. And Thursday.)


Actually, It *is* Thursday if you use UTC:

$ TZ=UTC php -r 'echo date("r",NULL),"\n";'
Thu, 01 Jan 1970 00:00:00 +

:P


Perfect example of Tedd's last comment about being proven wrong  
(even though TECHNICALLY it isn't)


Good job :)


To all:

Okay, so now that we have had people reply, here's my take.

The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and that  
was a Thursday.


The second before (i.e., 31 December, 1969 23:59:59:59 + ) was  
null, which was Wednesday.


Now one might argue that everything before was null and I could  
accept that. But here's my code and reasoning, please follow:


$string = null;
$seconds = strtotime($string);// change string into seconds
date = getdate($seconds);// change seconds into a date
$computedDate = $date['mday'] . ' ' . $date['month'] . ', ' . $date 
['year'] . ' : ' .$date['weekday'];

echo($computedDate);// show date

Thus, null is Wednesday.

Now, why is this wrong?

Cheers,

tedd

_
t...@sperling.com
http://sperling.com







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



That's just it -- it's not wrong -- it's just local

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Tamara Temple



On Nov 17, 2011, at 10:33 AM, Tedd Sperling   
wrote:



On Nov 17, 2011, at 11:07 AM, Stuart Dallas wrote:

On 17 Nov 2011, at 16:01, Tedd Sperling wrote:
To all:


Okay, so now that we have had people reply, here's my take.

The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and  
that was a Thursday.


The second before (i.e., 31 December, 1969 23:59:59:59 + ) was  
null, which was Wednesday.


I take issue with this. The second before was -1 seconds from the  
epoch. Null is the absence of a value, so you can't get to null by  
simple arithmetic. I learnt about negative numbers from the Greeks.  
And no, I'm not going to comment on their current mathematical  
difficulties.


Hmm.

D'oh!

But the point still stands: -1 !== null.

-Stuart


Leave it to you to get all Greek on me. :-)

Consider this -- do you think the second before the "Big Bang" was  
negative or null?


Likewise, the Unix timestamp was defined to start at a specific  
point in time -- it does not address/define what time came before.  
Thus, what came before was not negative, but rather 'undefined'. I  
claim 'null' is a better fit for 'undefined' than negative -- plus  
it works.


For example, if you push '-1' though strtotime(-1), you'll get  
Wednesday only one day a week -- whereas 'null' works every time.


My point stands: null == Wednesday.   :-)

Cheers,

tedd


_
t...@sperling.com
http://sperling.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



As I clearly demonstrated, that depends on where you're standing :)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Robert Cummings

On 11-11-17 11:33 AM, HallMarc Websites wrote:



To all:

Okay, so now that we have had people reply, here's my take.

The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and that was

a

Thursday.


The second before (i.e., 31 December, 1969 23:59:59:59 + ) was null,

which was Wednesday.

I take issue with this. The second before was -1 seconds from the epoch.

Null

is the absence of a value, so you can't get to null by simple arithmetic.

I learnt

about negative numbers from the Greeks. And no, I'm not going to comment
on their current mathematical difficulties.

Hmm.

D'oh!

But the point still stands: -1 !== null.

-Stuart



What if we were to throw in quantum duality in here?  Null and !Null at the
same time


False

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Stuart Dallas
On 17 Nov 2011, at 16:33, Tedd Sperling wrote:
> On Nov 17, 2011, at 11:07 AM, Stuart Dallas wrote:
>> On 17 Nov 2011, at 16:01, Tedd Sperling wrote:
>> To all:
>>> 
>>> Okay, so now that we have had people reply, here's my take.
>>> 
>>> The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and that was a 
>>> Thursday.
>>> 
>>> The second before (i.e., 31 December, 1969 23:59:59:59 + ) was null, 
>>> which was Wednesday.
>> 
>> I take issue with this. The second before was -1 seconds from the epoch. 
>> Null is the absence of a value, so you can't get to null by simple 
>> arithmetic. I learnt about negative numbers from the Greeks. And no, I'm not 
>> going to comment on their current mathematical difficulties.
>> 
>> Hmm.
>> 
>> D'oh!
>> 
>> But the point still stands: -1 !== null.
>> 
>> -Stuart
> 
> Leave it to you to get all Greek on me. :-)
> 
> Consider this -- do you think the second before the "Big Bang" was negative 
> or null?

I don't know. There's no point concerning ourselves with unanswerable questions.

> Likewise, the Unix timestamp was defined to start at a specific point in time 
> -- it does not address/define what time came before. Thus, what came before 
> was not negative, but rather 'undefined'. I claim 'null' is a better fit for 
> 'undefined' than negative -- plus it works.

The epoch specifies the exact time that 0 represents. It makes no claims as far 
as that being the start of anything...

"defined as the number of seconds elapsed since midnight Coordinated Universal 
Time (UTC) of Thursday, January 1, 1970 (Unix times are defined, but negative, 
before that date)" [http://en.wikipedia.org/wiki/Unix_time]

> For example, if you push '-1' though strtotime(-1), you'll get Wednesday only 
> one day a week -- whereas 'null' works every time.

Technically I see that as a bug. I believe strtotime(null) should return null, 
but due to the way type inference works, null is interpreted as 0. The point 
here being that you're not getting the time at null, you're getting the time at 
0.

> My point stands: null == Wednesday.   :-)


It may stand, but it's standing on foundations of null space :)

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Sniping on the List

2011-11-17 Thread HallMarc Websites
> 
> > To all:
> >
> > Okay, so now that we have had people reply, here's my take.
> >
> > The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and that was
a
> Thursday.
> >
> > The second before (i.e., 31 December, 1969 23:59:59:59 + ) was null,
> which was Wednesday.
> 
> I take issue with this. The second before was -1 seconds from the epoch.
Null
> is the absence of a value, so you can't get to null by simple arithmetic.
I learnt
> about negative numbers from the Greeks. And no, I'm not going to comment
> on their current mathematical difficulties.
> 
> Hmm.
> 
> D'oh!
> 
> But the point still stands: -1 !== null.
> 
> -Stuart
> 

What if we were to throw in quantum duality in here?  Null and !Null at the
same time


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Tedd Sperling
On Nov 17, 2011, at 11:07 AM, Stuart Dallas wrote:
> On 17 Nov 2011, at 16:01, Tedd Sperling wrote:
> To all:
>> 
>> Okay, so now that we have had people reply, here's my take.
>> 
>> The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and that was a 
>> Thursday.
>> 
>> The second before (i.e., 31 December, 1969 23:59:59:59 + ) was null, 
>> which was Wednesday.
> 
> I take issue with this. The second before was -1 seconds from the epoch. Null 
> is the absence of a value, so you can't get to null by simple arithmetic. I 
> learnt about negative numbers from the Greeks. And no, I'm not going to 
> comment on their current mathematical difficulties.
> 
> Hmm.
> 
> D'oh!
> 
> But the point still stands: -1 !== null.
> 
> -Stuart

Leave it to you to get all Greek on me. :-)

Consider this -- do you think the second before the "Big Bang" was negative or 
null?

Likewise, the Unix timestamp was defined to start at a specific point in time 
-- it does not address/define what time came before. Thus, what came before was 
not negative, but rather 'undefined'. I claim 'null' is a better fit for 
'undefined' than negative -- plus it works.

For example, if you push '-1' though strtotime(-1), you'll get Wednesday only 
one day a week -- whereas 'null' works every time.

My point stands: null == Wednesday.   :-)

Cheers,

tedd


_
t...@sperling.com
http://sperling.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Stuart Dallas

On 17 Nov 2011, at 16:01, Tedd Sperling wrote:

> To all:
> 
> Okay, so now that we have had people reply, here's my take.
> 
> The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and that was a 
> Thursday.
> 
> The second before (i.e., 31 December, 1969 23:59:59:59 + ) was null, 
> which was Wednesday.

I take issue with this. The second before was -1 seconds from the epoch. Null 
is the absence of a value, so you can't get to null by simple arithmetic. I 
learnt about negative numbers from the Greeks. And no, I'm not going to comment 
on their current mathematical difficulties.

Hmm.

D'oh!

But the point still stands: -1 !== null.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-17 Thread Tedd Sperling
On Nov 15, 2011, at 2:54 PM, Steven Staples wrote:
>>  sent:
>>>  wrote:
 PS: I know it's not Friday, but this question came up in class
 yesterday and I thought maybe all of you might like to guess why
 null is Wednesday?
>>> 
>>> Wait.. What??
>>> 
>>> $ php -r 'echo date("l",NULL),"\n";'
>>> Wednesday
>>> 
>>> Cos:
>>> 
>>> $ php -r 'echo date("r",NULL),"\n";'
>>> Wed, 31 Dec 1969 18:00:00 -0600
>>> 
>>> (Personally, I would have thought Thursday should be NULL, but that's
>>> just me. And Thursday.)
>> 
>> Actually, It *is* Thursday if you use UTC:
>> 
>> $ TZ=UTC php -r 'echo date("r",NULL),"\n";'
>> Thu, 01 Jan 1970 00:00:00 +
>> 
>> :P
> 
> Perfect example of Tedd's last comment about being proven wrong (even though 
> TECHNICALLY it isn't)
> 
> Good job :)

To all:

Okay, so now that we have had people reply, here's my take.

The Unix timestamp started on 01 Jan 1970 00:00:00 + -- and that was a 
Thursday.

The second before (i.e., 31 December, 1969 23:59:59:59 + ) was null, which 
was Wednesday.

Now one might argue that everything before was null and I could accept that. 
But here's my code and reasoning, please follow:

$string = null;
$seconds = strtotime($string);// change string into seconds 
date = getdate($seconds);// change seconds into a date 
$computedDate = $date['mday'] . ' ' . $date['month'] . ', ' . $date['year'] . ' 
: ' .$date['weekday'];
echo($computedDate);// show date

Thus, null is Wednesday.

Now, why is this wrong?

Cheers,

tedd

_
t...@sperling.com
http://sperling.com







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-15 Thread Govinda
> 
> You should have seen some of the lambasting that used to pass as
> discourse back when this list had traffic.  :]

I have to (humbly) admit that I for one like it that this list has less traffic 
now  because it gives the illusion that I am keeping up ;-)

-Govinda





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-15 Thread Eric Butera
On Mon, Nov 14, 2011 at 12:51 PM, George Langley  wrote:
>        Am concerned over the number of posts that appear to be from people 
> trying to over-inflate their self-importance.
>        If you are the world's best coder, then help those of us who aren't. 
> If you happen to know a better way to do something that I'm struggling with, 
> then please share it. But if you just want to take pot shots at us, then 
> please keep your comments to yourself.
>
>        To that end, I wish to thank Ashley Sheridan, Daniel P. Brown, Tedd 
> Sperling and Tommy Pham, to name but just a few of those who have submitted 
> incredibly-helpful posts, that I have kept for reference. Your contributions 
> are very much appreciated - thanks.
>
>
> George Langley
> Interactive Developer
>
> www.georgelangley.ca


You should have seen some of the lambasting that used to pass as
discourse back when this list had traffic.  :]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Sniping on the List

2011-11-15 Thread Steven Staples
> -Original Message-
> From: Tamara Temple [mailto:tamouse.li...@tamaratemple.com]
> Sent: November 15, 2011 1:33 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Sniping on the List
> 
> On Tue, 15 Nov 2011 12:24:17 -0600, tamouse mailing lists
>  sent:
> > On Tue, Nov 15, 2011 at 12:12 PM, Tedd Sperling
> >  wrote:
> >> PS: I know it's not Friday, but this question came up in class
> >> yesterday and I thought maybe all of you might like to guess why
> >> null is Wednesday?
> >
> > Wait.. What??
> >
> > $ php -r 'echo date("l",NULL),"\n";'
> > Wednesday
> >
> > Cos:
> >
> > $ php -r 'echo date("r",NULL),"\n";'
> > Wed, 31 Dec 1969 18:00:00 -0600
> >
> > (Personally, I would have thought Thursday should be NULL, but that's
> > just me. And Thursday.)
> 
> Actually, It *is* Thursday if you use UTC:
> 
> $ TZ=UTC php -r 'echo date("r",NULL),"\n";'
> Thu, 01 Jan 1970 00:00:00 +
> 
> :P

Perfect example of Tedd's last comment about being proven wrong (even though 
TECHNICALLY it isn't)

Good job :)


Steven Staples
Web Application Programmer




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-15 Thread Tamara Temple
On Tue, 15 Nov 2011 12:24:17 -0600, tamouse mailing lists  
 sent:
On Tue, Nov 15, 2011 at 12:12 PM, Tedd Sperling   
 wrote:
PS: I know it's not Friday, but this question came up in class   
yesterday and I thought maybe all of you might like to guess why   
null is Wednesday?


Wait.. What??

$ php -r 'echo date("l",NULL),"\n";'
Wednesday

Cos:

$ php -r 'echo date("r",NULL),"\n";'
Wed, 31 Dec 1969 18:00:00 -0600

(Personally, I would have thought Thursday should be NULL, but that's
just me. And Thursday.)


Actually, It *is* Thursday if you use UTC:

$ TZ=UTC php -r 'echo date("r",NULL),"\n";'
Thu, 01 Jan 1970 00:00:00 +

:P


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-15 Thread tamouse mailing lists
On Tue, Nov 15, 2011 at 12:12 PM, Tedd Sperling  wrote:
> PS: I know it's not Friday, but this question came up in class yesterday and 
> I thought maybe all of you might like to guess why null is Wednesday?

Wait.. What??

$ php -r 'echo date("l",NULL),"\n";'
Wednesday

Cos:

$ php -r 'echo date("r",NULL),"\n";'
Wed, 31 Dec 1969 18:00:00 -0600

(Personally, I would have thought Thursday should be NULL, but that's
just me. And Thursday.)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-15 Thread Tedd Sperling
On Nov 14, 2011, at 12:51 PM, George Langley wrote:

>   Am concerned over the number of posts that appear to be from people 
> trying to over-inflate their self-importance.
>   If you are the world's best coder, then help those of us who aren't. If 
> you happen to know a better way to do something that I'm struggling with, 
> then please share it. But if you just want to take pot shots at us, then 
> please keep your comments to yourself.
> 
>   To that end, I wish to thank Ashley Sheridan, Daniel P. Brown, Tedd 
> Sperling and Tommy Pham, to name but just a few of those who have submitted 
> incredibly-helpful posts, that I have kept for reference. Your contributions 
> are very much appreciated - thanks.
> 
> George Langley
> Interactive Developer
> 

George:

Over-inflated self importance? That certainly sounds like me. :-)

On a serious note, don't be too hash on those who contribute -- keep in mind 
that in contributing we all learn -- this often includes the contributor as 
well. Nothing like being proven wrong to humble oneself.

For example, I teach this stuff and several times over the course of a semester 
I have had students ask questions and then question my answers. Then after 
investigation to find my answer wrong -- now that's humbling, but that's part 
of the leaning process.

So, my recommendation is to take and give what you can and leave judgement of 
the posters to the general audience -- the truth will win out.

Cheers,

tedd

PS: I know it's not Friday, but this question came up in class yesterday and I 
thought maybe all of you might like to guess why null is Wednesday?

_
t...@sperling.com
http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sniping on the List

2011-11-14 Thread Fredric L. Rice
> If you are the world's best coder

That would be me. :)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php