date stamp help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
VeeDubZ
Forum Newbie
Posts: 2
Joined: Fri Aug 15, 2008 1:54 pm

date stamp help

Post by VeeDubZ »

hi all im currently learning php as my partner has recently opened an online pet sim game using a premade script....but im having problems with a part of the site which generates a time stamp.

the problem is that the time is wrong for my time zone i need it to add 8 hours to the time. the code it uses for this part of the site is

Code: Select all

$generated = date("F j, Y, g:i a",$findGeneratedStats[generated]);
im pretty sure its somthing simple that im overlooking but i cant see whwere to add the -28800 seconds offset

can anyone help me out with this??
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: date stamp help

Post by Zoxive »

If you have access to the php.ini file, you edit the following entry..

Code: Select all

.....
[Date]
; Defines the default timezone used by the date functions
date.timezone = America/Chicago
America/Chicago was used as an example.

You can also use the date_default_timezone_set function if you have php5 or greater.

Code: Select all

date_default_timezone_set('America/Chicago');
List of supported time zones: http://www.php.net/manual/en/timezones.php
VeeDubZ
Forum Newbie
Posts: 2
Joined: Fri Aug 15, 2008 1:54 pm

Re: date stamp help

Post by VeeDubZ »

yes i have access to the php.ini file and below are the entire contents of the file:

Code: Select all

register_globals = Off
extension=php_gd2.dll
 
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.6
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.6
zend_optimizer.version=3.2.6
zend_extension = /usr/local/ioncube/ioncube_loader_lin_4.4.so
 
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
 
so where would i need to put the date info if i were setting the time as GMT(Europe/London)?
Post Reply