<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Time Zone error]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8234&amp;type=atom" />
	<updated>2021-01-10T08:49:09Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8234</id>
		<entry>
			<title type="html"><![CDATA[Re: Time Zone error]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38903#p38903" />
			<content type="html"><![CDATA[<p>Hello:<br />For me, in ubuntu worked editing&nbsp; php.ini in /etc/php/7.4/apache2/ with nano or gedit (I&#039;m on php 7.4)<br />First make a copy of your php.ini, then:</p><p>sudo gedit /etc/php/7.4/apache2/php.ini</p><p>find:<br />;date.timezone = </p><p>replace it with:<br />date.timezone = &#039;YourContinent/YourCity&#039; (and no &quot;;&quot; at start&nbsp; <img src="https://frontaccounting.com/punbb/img/smilies/wink.png" width="15" height="15" alt="wink" /> )</p><p>Example:<br />date.timezone = &#039;America/Santiago&#039; </p><p>Save, exit.</p><br /><p>restart apache2:<br />sudo systemctl restart apache2</p><p>Saludos<br />Victor R.</p>]]></content>
			<author>
				<name><![CDATA[Caribe95]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=14659</uri>
			</author>
			<updated>2021-01-10T08:49:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38903#p38903</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Time Zone error]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=35277#p35277" />
			<content type="html"><![CDATA[<p>The default <strong>time_zone</strong> is defined in the <strong>sys_prefs</strong> table.<br />It is also conditionally set as a <strong>php.ini</strong> variable in the <strong>config.php</strong> file.</p><p>The order of Timezone precedence in the <strong>includes/prefs/sysprefs.inc</strong> is in lines 33 to 45:<br /></p><div class="codebox"><pre><code>        foreach(get_defined_vars() as $name =&gt; $value)
            $this-&gt;$name = $value;

        if (!@$this-&gt;time_zone)
            $this-&gt;time_zone = ini_get(&#039;date.timezone&#039;);

        if (!$this-&gt;time_zone)
            $this-&gt;time_zone = &#039;Europe/Berlin&#039;;
            
        if (!isset($this-&gt;use_popup_search))
            $this-&gt;use_popup_search = false;

           ini_set(&#039;date.timezone&#039;, $this-&gt;time_zone);</code></pre></div><p>This does not respect the <strong>php.ini</strong>&#039;s value (or its&#039; scripted set value from the <strong>config.php</strong>) and in actuality gets overwritten by the <strong>&#039;Europe/Berlin&#039;</strong> fallback value and reflects in the footer timestamp displayed in the FA pages even after login whence a <em>current_user</em> is available in the session variable.</p><p>The solution is to make an unconditional setting in the <strong>config.</strong>(<em>config.default.php</em>) file by replacing lines 25-26:<br /></p><div class="codebox"><pre><code>    if (!ini_get(&#039;date.timezone&#039;))
        ini_set(&#039;date.timezone&#039;, &#039;Europe/Berlin&#039;);</code></pre></div><p>with<br /></p><div class="codebox"><pre><code>    ini_set(&#039;date.timezone&#039;, &#039;Europe/Berlin&#039;);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-06-21T12:08:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=35277#p35277</id>
		</entry>
</feed>
