FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: nscelica on February 17, 2006, 02:23:35 AM

Title: Timezone adjustment
Post by: nscelica on February 17, 2006, 02:23:35 AM
Ok, i'm guessing its not possible to adjust the time zone for my hosting? (I'm using the Plesk server).

Anyone know if it is possible to change the timezone?
Title: Re: Timezone adjustment
Post by: webzone (archived) on February 17, 2006, 03:26:54 AM
The timezone is a systemwide setting and cannot be changed by individual users.

However, using the built-in PHP functions, you can convert timestamps from one timezone to the other if that is what you need.
Title: Re: Timezone adjustment
Post by: GP™ on February 17, 2006, 05:40:59 AM
First, you need to calculate the time difrence from the server time and the local time.

then use this script:

<?php
$differencetolocaltime
=4//Input time difrence
$new_U=date("U")-$differencetolocaltime*3600//If the time is ahead of the server change the - to a +
print date("H:i"$new_U); //This will echo the time
?>


Read the comments for use, if you have probs let me know!

A good "GENERAL" time tutoral of php is this: http://www.phptutorial.info/learn/datetime.html
It states, in detail how to use the time function and, also, it shows the above method.
Title: Re: Timezone adjustment
Post by: dest on February 17, 2006, 09:57:07 PM
I thought php 5 (which I assume is on plesk server too) had a new shiny timezone feature

date_default_timezone_set('UTC');
Title: Re: Timezone adjustment
Post by: webzone (archived) on February 17, 2006, 10:00:27 PM
QuoteI thought php 5 (which I assume is on plesk server too) had a new shiny timezone feature

date_default_timezone_set('UTC');

This feature is only available in PHP 5.1.0 onwards, however we are using PHP 5.0.4 (+ security patches).
Title: Re: Timezone adjustment
Post by: dest on February 18, 2006, 12:22:56 AM
Curses...  :D