php-general Digest 23 Nov 2011 07:47:31 -0000 Issue 7581

Topics (messages 315790 through 315795):

Re: Sniping on the List
        315790 by: Curtis Maurand
        315795 by: Geoff Shang

API for something like phpsysinfo?
        315791 by: Michelle Konzack
        315792 by: Jim Lucas
        315794 by: Michelle Konzack

Re: PHP script won't run in the background
        315793 by: richard gray

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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 +0000

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 +0000" (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 +0000

$ php -r 'date_default_timezone_set ("America/New_York"); echo date ("r", null);'
Wed, 31 Dec 1969 19:00:00 -0500

Geoff.


--- End Message ---
--- Begin Message ---
Hello *,

is there something like an API to "phpsysinfo"?

I have the need to access more then 4800 Servers from scripts and I like
to do it over https.  The infos on "phpsysinfo" are already enough,  but
I need the values in a script

Any suggestions?

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux
               Internet Service Provider, Cloud Computing
                <http://www.itsystems.tamay-dogan.net/>

itsystems@tdnet                     Jabber  linux4miche...@jabber.ccc.de
Owner Michelle Konzack

Gewerbe Strasse 3                   Tel office: +49-176-86004575
77694 Kehl                          Tel mobil:  +49-177-9351947
Germany                             Tel mobil:  +33-6-61925193  (France)

USt-ID:  DE 278 049 239

Linux-User #280138 with the Linux Counter, http://counter.li.org/

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
On 11/22/2011 6:24 AM, Michelle Konzack wrote:
> Hello *,
> 
> is there something like an API to "phpsysinfo"?
> 
> I have the need to access more then 4800 Servers from scripts and I like
> to do it over https.  The infos on "phpsysinfo" are already enough,  but
> I need the values in a script
> 
> Any suggestions?
> 
> Thanks, Greetings and nice Day/Evening
>     Michelle Konzack
> 

Use the XML output option and parse returned data.

-- 
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

C - (541) 408-5189
O - (541) 323-9113
H - (541) 323-4219

--- End Message ---
--- Begin Message ---
Hello Jim Lucas,

Am 2011-11-22 08:49:49, hacktest Du folgendes herunter:
> Use the XML output option and parse returned data.

Fsck!  --  Forgotten about it!  :-S

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux
               Internet Service Provider, Cloud Computing
                <http://www.itsystems.tamay-dogan.net/>

itsystems@tdnet                     Jabber  linux4miche...@jabber.ccc.de
Owner Michelle Konzack

Gewerbe Strasse 3                   Tel office: +49-176-86004575
77694 Kehl                          Tel mobil:  +49-177-9351947
Germany                             Tel mobil:  +33-6-61925193  (France)

USt-ID:  DE 278 049 239

Linux-User #280138 with the Linux Counter, http://counter.li.org/

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
On 22/11/2011 05:51, Laruence wrote:
did you run php with readline?  try run the script without php-readline.

thanks
No - the script was just a basic string echo - no readline was involved.

--- End Message ---

Reply via email to