Change timezone on PHP
Programming March 22nd, 2011
There are some methods that allows you to change the timezone of the PHP (5.1+) scripts (ie, when the date is not shown due to a different timezone of the server).
The first one is by modifying the php.ini file of the web server (if you are allowed to). We just need to add the following line:
date.timezone = "America/Lima"
Other method is using the ini_set() function directly on your script (at the beginning of it), this way:
ini_set('date.timezone', 'America/Lima');
And the third method consist on the use of the function date_default_timezone_set() (also, directly on your script):
date_default_timezone_set('America/Lima');
The list of the available timezones is here.
Sources: SiteGround, The Electric Toolbox
Use Drupal installation’s base URL on theme/template
Drupal, Web May 6th, 2009
To be able to use base URL (server URL and subdirectory where Drupal is installed if any, like http://mydomain.com/drupal) on themes or content templates, $base_url scope must be modified before it can be used. Before your theme code, you should write:
< ?php global $base_url; (rest of theme/template code) ?>
Tags: Drupal 6, Drupal Themes, PHP, URL
About