Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
kd8hho
Worker
Worker



Joined: Mar 30, 2009
Posts: 118

PostPosted: Sat Mar 03, 2012 9:12 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6795
Location: Ha Noi, Viet Nam

PostPosted: Sat Mar 03, 2012 9:36 am Reply with quote

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");
 
View user's profile Send private message Send e-mail
kd8hho







PostPosted: Sat Mar 03, 2012 10:05 pm Reply with quote

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
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sat Mar 03, 2012 11:13 pm Reply with quote

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
 
View user's profile Send private message Visit poster's website
kd8hho







PostPosted: Sun Mar 04, 2012 12:10 am Reply with quote

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 Smile


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
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Sun Mar 04, 2012 6:17 am Reply with quote

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();
}

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
kd8hho







PostPosted: Sun Mar 04, 2012 4:27 pm Reply with quote

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.
 
nuken







PostPosted: Sun Mar 04, 2012 4:34 pm Reply with quote

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.
 
Guardian2003







PostPosted: Sun Mar 04, 2012 4:41 pm Reply with quote

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.
 
Guardian2003







PostPosted: Sun Mar 04, 2012 4:55 pm Reply with quote

@ 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.
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1008
Location: Netherland

PostPosted: Sun Mar 04, 2012 5:40 pm Reply with quote

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.
 
View user's profile Send private message Visit poster's website
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6404

PostPosted: Sun Mar 04, 2012 7:58 pm Reply with quote

If you get errors by commenting out that line, you can find your server's timezone here: [ Only registered users can see links on this board! Get registered or login! ]

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 google, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
kd8hho







PostPosted: Mon Mar 05, 2012 1:05 pm Reply with quote

kguske wrote:


Just replace UTC with the correct time zone.


bingo, that worked.
 
mike63740
Worker
Worker



Joined: Jun 21, 2010
Posts: 101

PostPosted: Fri May 18, 2012 7:23 pm Reply with quote

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.
kguske wrote:
you can find your server's timezone here: [ Only registered users can see links on this board! Get registered or login! ]
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.
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1512

PostPosted: Fri May 18, 2012 8:02 pm Reply with quote

works ('EDT') ?
 
View user's profile Send private message
mike63740







PostPosted: Fri May 18, 2012 8:10 pm Reply with quote

No, returned to default.
 
neralex







PostPosted: Fri May 18, 2012 8:15 pm Reply with quote

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
 
mike63740







PostPosted: Fri May 18, 2012 8:23 pm Reply with quote

Where do I put this code? In block-User_Info.php.
 
neralex







PostPosted: Fri May 18, 2012 8:26 pm Reply with quote

yes...

Code:
if ( !defined('BLOCK_FILE') ) {

    Header("Location: ../index.php");
    die();
}
date_default_timezone_set('America/New_York');
 
mike63740







PostPosted: Fri May 18, 2012 8:27 pm Reply with quote

Remember, my time zone code is not listed in the list of Supported Timezones.
 
neralex







PostPosted: Fri May 18, 2012 8:33 pm Reply with quote

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?
 
mike63740







PostPosted: Fri May 18, 2012 8:39 pm Reply with quote

I replaced this:
date_default_timezone_set('EST');

with

date_default_timezone_set('America/New_York');

It works! It works! It works! Very Happy Smile Surprised Shocked Cool Laughing

Thank you.
 
neralex







PostPosted: Fri May 18, 2012 8:41 pm Reply with quote

haha wonderfull Smile

RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©