Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14287 > unrolled thread

timezone

Started bybill <william@TechServSys.com>
First post2014-10-09 15:22 -0400
Last post2014-10-09 21:52 +0100
Articles 5 on this page of 25 — 6 participants

Back to article view | Back to comp.lang.php


Contents

  timezone bill <william@TechServSys.com> - 2014-10-09 15:22 -0400
    Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-09 21:58 +0200
      Re: timezone Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-09 16:23 -0400
        Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-09 22:47 +0200
          Re: timezone Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-09 20:54 -0400
            Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-10 16:08 +0200
              Re: timezone Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2014-10-10 14:19 +0000
                Re: timezone Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-10 10:47 -0400
                Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-10 16:58 +0200
                  Re: timezone Tim Streater <timstreater@greenbee.net> - 2014-10-10 21:59 +0100
                    Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-11 13:40 +0200
                  Re: timezone Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2014-10-11 09:02 +0000
                    Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-11 13:37 +0200
                      Re: timezone Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-11 10:25 -0400
              Re: timezone bill <william@TechServSys.com> - 2014-10-10 13:49 -0400
      Re: timezone bill <william@TechServSys.com> - 2014-10-10 07:45 -0400
      Re: timezone bill <william@TechServSys.com> - 2014-10-10 07:56 -0400
        Re: timezone Matthew Carter <m@ahungry.com> - 2014-10-10 09:55 -0400
          Re: timezone Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-10 10:52 -0400
        Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-10 16:17 +0200
    Re: timezone Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-09 16:20 -0400
      Re: timezone Matthew Carter <m@ahungry.com> - 2014-10-09 17:16 -0400
        Re: timezone Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-09 23:38 +0200
        Re: timezone Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-09 20:56 -0400
    Re: timezone Tim Streater <timstreater@greenbee.net> - 2014-10-09 21:52 +0100

Page 2 of 2 — ← Prev page 1 [2]


#14289

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-10-09 16:20 -0400
Message-ID<m16qn6$vvo$1@dont-email.me>
In reply to#14287
On 10/9/2014 3:22 PM, bill wrote:
> I just updated to Ubuntu 14.04 LTS (php5.5)and in addition to the usual
> stuff I now am getting errors when I use date functions.
> Warning: date(): Invalid date.timezone value 'America.Detroit', we
> selected the timezone 'UTC' for now. in
> /var/www/html/MP2010-v2/general/clock.php on line 6
> 
> I did a find and found:
> william@ubuntu:/etc/php5/apache2$ sudo find / -name php.ini -print
> /etc/php5/apache2/php.ini
> /etc/php5/cli/php.ini
> 
> I changed them both to
> ; Defines the default timezone used by the date functions
> date.timezone =America/Detroit
> 
> as per http://php.net/manual/en/timezones.america.php
> 
> suggestions?
> 
> -bill

Are you sure of your change?  The message seems to indicate you have
America.Detroit, not America/Detroit.  The former would be incorrect.

Also, phpinfo() will give you information on which php.ini you are using.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#14293

FromMatthew Carter <m@ahungry.com>
Date2014-10-09 17:16 -0400
Message-ID<87tx3dq6yn.fsf@ahungry.com>
In reply to#14289
Jerry Stuckle <jstucklex@attglobal.net> writes:


> Are you sure of your change?  The message seems to indicate you have
> America.Detroit, not America/Detroit.  The former would be incorrect.
>
> Also, phpinfo() will give you information on which php.ini you are using.

I like using:

php --ini

Configuration File (php.ini) Path: /etc/php
Loaded Configuration File:         /etc/php/php.ini
Scan for additional .ini files in: /etc/php/conf.d
Additional .ini files parsed:      /etc/php/conf.d/apcu.ini



-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com

[toc] | [prev] | [next] | [standalone]


#14294

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2014-10-09 23:38 +0200
Message-ID<18356659.JnX3sOiSR0@PointedEars.de>
In reply to#14293
Matthew Carter wrote:

> Jerry Stuckle <jstucklex@attglobal.net> writes:
>> Are you sure of your change?  The message seems to indicate you have
>> America.Detroit, not America/Detroit.  The former would be incorrect.
>>
>> Also, phpinfo() will give you information on which php.ini you are using.
> 
> I like using:
> 
> php --ini
> 
> Configuration File (php.ini) Path: /etc/php
> Loaded Configuration File:         /etc/php/php.ini
> Scan for additional .ini files in: /etc/php/conf.d
> Additional .ini files parsed:      /etc/php/conf.d/apcu.ini

Nice.  However, note that this will only give you the files for the CLI, 
while

  phpinfo(INFO_GENERAL);

is runtime-independent.

It should also be noted that none of the above provides information about 
PHP configuration directives set via Windows registry, server configuration, 
or user scripts.  The last one might be the case here as “date.timezone”
is PHP_INI_ALL-Changeable; if all else fails, RE-searching the source code 
case-insensitively for

  \bini_set\s*\(\s*["']date.timezone["']\s*,\s*["']America\.Detroit["']

and the like (the parameters of the call could be string constants) could 
prove useful.

<http://php.net/phpinfo>
<http://php.net/manual/en/ini.list.php>

-- 
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#14296

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-10-09 20:56 -0400
Message-ID<m17ar3$9ti$2@dont-email.me>
In reply to#14293
On 10/9/2014 5:16 PM, Matthew Carter wrote:
> Jerry Stuckle <jstucklex@attglobal.net> writes:
> 
> 
>> Are you sure of your change?  The message seems to indicate you have
>> America.Detroit, not America/Detroit.  The former would be incorrect.
>>
>> Also, phpinfo() will give you information on which php.ini you are using.
> 
> I like using:
> 
> php --ini
> 
> Configuration File (php.ini) Path: /etc/php
> Loaded Configuration File:         /etc/php/php.ini
> Scan for additional .ini files in: /etc/php/conf.d
> Additional .ini files parsed:      /etc/php/conf.d/apcu.ini
> 
> 
> 

Which is fine if you're using the CLI version of PHP.  But if you're
running as an Apache module, you can easily get the wrong answer.

phpinfo() gives the current information no matter which version you're
using.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#14292

FromTim Streater <timstreater@greenbee.net>
Date2014-10-09 21:52 +0100
Message-ID<091020142152294687%timstreater@greenbee.net>
In reply to#14287
In article <m16n9n$kpd$1@speranza.aioe.org>, bill
<william@TechServSys.com> wrote:

> I just updated to Ubuntu 14.04 LTS (php5.5)and in addition to the 
> usual stuff I now am getting errors when I use date functions.
> Warning: date(): Invalid date.timezone value 'America.Detroit', 
> we selected the timezone 'UTC' for now. in 
> /var/www/html/MP2010-v2/general/clock.php on line 6
> 
> I did a find and found:
> william@ubuntu:/etc/php5/apache2$ sudo find / -name php.ini -print
> /etc/php5/apache2/php.ini
> /etc/php5/cli/php.ini
> 
> I changed them both to
> ; Defines the default timezone used by the date functions
> date.timezone =America/Detroit
> 
> as per http://php.net/manual/en/timezones.america.php

Yes, it would need to be "America/Detroit", see:

  https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Second, you could add:

  php_value date.timezone "America/Detroit"

to your apache config file.

Third, if you're doing something where you want your PHP setup to
reflect the time-zone actually set on your machine (e.g. you're making
an app for use by others or even if it's your laptop that you take
elsewhere), you can do this in PHP:

  $timezone = 'America/Detroit';          // Default for time zone

  $fp = fopen ('/etc/timezone', 'r');
  if  ($fp!==false)
       {
       $timezone = trim (fgets ($fp));    // Read what it actually is
       }
  fclose ($fp);

  date_default_timezone_set ($timezone);

This will work for Ubuntu.

-- 
"Once you adopt the unix paradigm, the variants cease to be a problem - you
bitch, of course, but that's because bitching is fun, unlike M$ OS's, where 
bitching is required to keep your head from exploding." - S Stremler in afc

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.php


csiph-web