Re: [PHP] Unix date (even more bazaar)

2007-12-30 Thread tedd

At 7:07 PM -0600 12/30/07, Richard Lynch wrote:

Spacing and/or control (unprintable) characters could easily be
messing you up.

Use something like:

$l = strlen($input);
for ($i = 0; $i < $l; $i++){
  echo "$i: $input[$i] (", ord($input[$i]), ")\n";
}
to see what you're getting.


Richard:

As usual, you are exactly right.

I found that somehow a gremlin had crept in -- I still don't 
understand how, but it did. So, I stepped through the string similar 
to what you did and replaced everything that wasn't supposed to be 
there.


Interesting that making a text file with the string and looking at it 
via a Hex Editor, I found that the gremlin was a 0A (new line), but 
when it was on the server, it was two characters ("High" ASCII 
194/160) -- very strange.


In any event, I fixed it. I didn't have the time to run down why.

Thanks,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Unix date (even more bazaar)

2007-12-30 Thread Richard Lynch
Spacing and/or control (unprintable) characters could easily be
messing you up.

Use something like:

$l = strlen($input);
for ($i = 0; $i < $l; $i++){
  echo "$i: $input[$i] (", ord($input[$i]), ")\n";
}
to see what you're getting.

On Fri, December 28, 2007 5:08 pm, tedd wrote:
> At 6:01 PM -0500 12/28/07, tedd wrote:
>>Hi gang:
>>
>>This really bazaar
>>
>>Here's the code and demo:
>>
>>http://webbytedd.com/c/unix-time1/index.php
>>
>>If I cut/paste the following string "as-is" into the "Input Date"
>>portion of the form:
>>
>>10-18-2009 00:00:00
>>
>>It works and returns a UNIX timestamp of 1255885200
>>
>>However, if I cut/paste the following string "as-is" into the "Input
>>Date" portion of the form:
>>
>>10-18-2009 00:00:00
>>
>>It doesn't work and returns a UNIX timestamp of "".
>>
>>Am I going mad? What the hell is the difference between these two
>> stings?
>>
>>Arr  I knew this day would come.
>>
>>tedd
>
>
> As I feared, the email translation made both strings identical -- so
> this won't work for those trying it.
>
> BUT, I do have two strings that look identical but aren't.
>
> I hate it when things like this happen.
>
> Cheers,
>
> tedd
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Unix date (even more bazaar)

2007-12-29 Thread tedd

Yeah, and to what bazaar are you going, old man?

Look, I'm so loopy right now, I'm top-posting.  How bizarre




Ohhh, I hate it when that happens -- but, I have had even more 
embarrassing moments.


As to the problem I posted about strings being different, it was a 
gremlin I found in the string. A hex edit of the file showed that the 
space between the date and time, which should have been a space (20) 
was actually a new line (0A) character.


Oh well, at least I found it.

Thanks all.

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Unix date (even more bazaar)

2007-12-28 Thread Daniel Brown
Yeah, and to what bazaar are you going, old man?

Look, I'm so loopy right now, I'm top-posting.  How bizarre

HAPPY NEW YEAR TO ALL, AND TO ALL SHUT THE HELL UP!

Be safe, happy, and healthy into 2008!





On Dec 28, 2007 6:16 PM, Dan <[EMAIL PROTECTED]> wrote:
> "tedd" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi gang:
> >
> > This really bazaar
> >
> > Here's the code and demo:
> >
> > http://webbytedd.com/c/unix-time1/index.php
> >
> > If I cut/paste the following string "as-is" into the "Input Date" portion
> > of the form:
> >
> > 10-18-2009 00:00:00
> >
> > It works and returns a UNIX timestamp of 1255885200
> >
> > However, if I cut/paste the following string "as-is" into the "Input Date"
> > portion of the form:
> >
> > 10-18-2009 00:00:00
> >
> > It doesn't work and returns a UNIX timestamp of "".
> >
> > Am I going mad? What the hell is the difference between these two stings?
> >
> > Arr  I knew this day would come.
> >
> > tedd
>
> Hi Tedd, next time you could just reply to your origional thread, you can
> change the subject without making  new thread, it's just harder for other
> people to follow.  Anyway, check out my response about storing and reading
> using GMT, it might help you.
>
> - Dan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



Re: [PHP] Unix date (even more bazaar)

2007-12-28 Thread Dan
"tedd" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Hi gang:

This really bazaar

Here's the code and demo:

http://webbytedd.com/c/unix-time1/index.php

If I cut/paste the following string "as-is" into the "Input Date" portion 
of the form:


10-18-2009 00:00:00

It works and returns a UNIX timestamp of 1255885200

However, if I cut/paste the following string "as-is" into the "Input Date" 
portion of the form:


10-18-2009 00:00:00

It doesn't work and returns a UNIX timestamp of "".

Am I going mad? What the hell is the difference between these two stings?

Arr  I knew this day would come.

tedd


Hi Tedd, next time you could just reply to your origional thread, you can 
change the subject without making  new thread, it's just harder for other 
people to follow.  Anyway, check out my response about storing and reading 
using GMT, it might help you.


- Dan 


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



Re: [PHP] Unix date (even more bazaar)

2007-12-28 Thread tedd

At 6:01 PM -0500 12/28/07, tedd wrote:

Hi gang:

This really bazaar

Here's the code and demo:

http://webbytedd.com/c/unix-time1/index.php

If I cut/paste the following string "as-is" into the "Input Date" 
portion of the form:


10-18-2009 00:00:00

It works and returns a UNIX timestamp of 1255885200

However, if I cut/paste the following string "as-is" into the "Input 
Date" portion of the form:


10-18-2009 00:00:00

It doesn't work and returns a UNIX timestamp of "".

Am I going mad? What the hell is the difference between these two stings?

Arr  I knew this day would come.

tedd



As I feared, the email translation made both strings identical -- so 
this won't work for those trying it.


BUT, I do have two strings that look identical but aren't.

I hate it when things like this happen.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Unix date (even more bazaar)

2007-12-28 Thread tedd

Hi gang:

This really bazaar

Here's the code and demo:

http://webbytedd.com/c/unix-time1/index.php

If I cut/paste the following string "as-is" into the "Input Date" 
portion of the form:


10-18-2009 00:00:00

It works and returns a UNIX timestamp of 1255885200

However, if I cut/paste the following string "as-is" into the "Input 
Date" portion of the form:


10-18-2009 00:00:00

It doesn't work and returns a UNIX timestamp of "".

Am I going mad? What the hell is the difference between these two stings?

Arr  I knew this day would come.

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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