News:

Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

Timezone adjustment

Started by nscelica, February 17, 2006, 02:23:35 AM

Previous topic - Next topic

nscelica

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?

webzone (archived)

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.

GP™

#2
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.

dest

I thought php 5 (which I assume is on plesk server too) had a new shiny timezone feature

date_default_timezone_set('UTC');
meh :P

webzone (archived)

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

dest

meh :P