Author |
Message |
kd8hho
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/62dea0774a2ec5e8975fc.png)
Joined: Mar 30, 2009
Posts: 132
|
Posted:
Sat Mar 03, 2012 9:12 am |
|
I had this working just fine.. and I noticed yesterday its boogered up again.
Server is in CA PST
I want Eastern time set.
on my host. i can edit php.ini which it saves in cgibin however via the host php.ini editor i can not set timezone.. so i downloaded that php.ini file and made and edit and added this
date.timezone = "America/New_York"
at 1st i thought maybe my host didnt like me doing that and removed it, so I checked its still there. however the site is showing UTC.
everything is set for NY/EST.
any ideas? |
_________________ Linux Register User #481509 | Ubuntu Register User #25492 |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Sat Mar 03, 2012 9:36 am |
|
Try using this in your script to diagnose the problem and confirm what you were expecting to sss
Code:echo date_default_timezone_get();
echo date('H:i:s');
date_default_timezone_set('UTC');
echo date_default_timezone_get();
echo date('H:i:s')
|
if your using PHP 5.3+ (which you probably are) you might be able to make use of these for date/time manipulation
Code:
$dateTime = new DateTime("now", new DateTimeZone('America/New_York'));
echo $dateTime->format("Y-m-d H:i:s");
$dateTimeZone = new DateTimeZone('UTC');
$dateTime->setTimezone($dateTimeZone);
echo $dateTime->format("Y-m-d H:i:s");
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kd8hho
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Mar 03, 2012 10:05 pm |
|
PHP Version is 5.2.17
ok. I made a quick script with the code in the 1st box. output below.
America/New_York23:00:54UTC04:00:54
so it looks to me as if php is rendering the time in NY/EST
now in the user info block
Server Info
Mar 04, 2012
04:01 am UTC
RN 02.50.00
So I can say for some reason nuke boogered the time. only add-on I have added is nukespam.
and I cant for the life of me think why nukespam would change everything on the site to show utc |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Sat Mar 03, 2012 11:13 pm |
|
I'm not real familiar with date formats, but the code used in that block was a carry-over from one block or another.
date('M d, Y');
date('h:i a T');
if that helps anyone ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kd8hho
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 04, 2012 12:10 am |
|
spasticdonkey wrote: | I'm not real familiar with date formats, but the code used in that block was a carry-over from one block or another.
date('M d, Y');
date('h:i a T');
if that helps anyone |
well I can say before I installed nukespam it was showing Ny/EST in the block,news,ect,ect
after nukespam install i notied its all changed to utc |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/3234de284ee21bd39eecd.jpg)
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Sun Mar 04, 2012 6:17 am |
|
What I do on my site is I put this code:
Code:
date_default_timezone_set('EST');
|
in my block-User_Info.php just after the
Code:
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
|
|
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kd8hho
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 04, 2012 4:27 pm |
|
my problem is this time issue is site wide.
any way maybe in mainfile to set time across the whole site to EST?
like I said my php.ini edits worked with nuke untill nukespam installed. (which I find really odd) but the .ini setting is working just not in nuke. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 04, 2012 4:34 pm |
|
When I put it in the block-User_Info.php, it did change it site wide for me. I tried putting it in mainfile, header, config, etc. but it did nothing until I placed it in the block. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 04, 2012 4:41 pm |
|
The only way I can think of that happening is if something else is overriding it with the PHP function
date_default_timezone_set();
I just did a quick global search and found it is used in modules/nukeSPAM/nukeSPAM.php around line 30 so this could bee the possible cause. You might want to comment that line out. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Mar 04, 2012 4:55 pm |
|
@ nuken - I haven't checked but that might be because the block is called after the nukeSPAM script and so it overrides it. I think ideally, you could set it in the web root index.php file (since nothing comes before that) and then comment out anything else that uses it.
I have notified kguske and a possible workaround but I have not had time to test it thoroughly as I', about to hit the sack. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Sun Mar 04, 2012 5:40 pm |
|
I already checked that mod from nuke and it works perfect! Just to tell u. If you are in Europe u shouldn't use that one. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
Site Admin
![](modules/Forums/images/avatars/41f0b40a419280935f3a0.gif)
Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Sun Mar 04, 2012 7:58 pm |
|
If you get errors by commenting out that line, you can find your server's timezone here: http://us.php.net/manual/en/timezones.php
Just replace UTC with the correct time zone.
I'm looking at modifying the code to make it configurable or at least not default it if it's already set (thanks, Guardian, for the suggestion and for the heads up on this). |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kd8hho
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Mar 05, 2012 1:05 pm |
|
kguske wrote: |
Just replace UTC with the correct time zone.
|
bingo, that worked. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mike63740
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/4437be354f1b121b97f6b.gif)
Joined: Jun 21, 2010
Posts: 102
|
Posted:
Fri May 18, 2012 7:23 pm |
|
RavenNuke 2.50.00 default time zone is ('PDT'), which is three hours behind my time zone.
nuken wrote: | What I do on my site is I put this code:
Code:
date_default_timezone_set('EST');
| in my block-User_Info.php just after the
Code:
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
| | nuken, I tried your code using time zone ('EST'), and it worked well, but still one hour behind my time zone.
When I use my time zone ('DST'), it returns to Raven default.
I did not find my time zone here, so I guest it's not supported.
Is there any way to move the clock up an hour?
Thanks. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
Site Admin
![](modules/Forums/images/avatars/201442295664a46e4575d46.jpg)
Joined: Aug 22, 2007
Posts: 1775
|
Posted:
Fri May 18, 2012 8:02 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mike63740
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:10 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:15 pm |
|
hmm and this?
date_default_timezone_set('America/New_York');
i am from germany ... google says:
22:14 Freitag (EDT) - Zeit in Washington, District of Columbia, USA
date_default_timezone_set('America/New_York'); >> 10:14 pm EDT |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mike63740
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:23 pm |
|
Where do I put this code? In block-User_Info.php. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:26 pm |
|
yes...
Code:if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
date_default_timezone_set('America/New_York');
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mike63740
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:27 pm |
|
Remember, my time zone code is not listed in the list of Supported Timezones. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:33 pm |
|
Many results of google to this issue comes with this answer for Washington, DC. I've just tried it and got this result. have you tried it? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mike63740
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:39 pm |
|
I replaced this:
date_default_timezone_set('EST');
with
date_default_timezone_set('America/New_York');
It works! It works! It works!
Thank you. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri May 18, 2012 8:41 pm |
|
haha wonderfull
![RavensScripts](modules/Forums/images/smiles/ravensphpscripts.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|