Run in GMT?

Is there anyway to run my VPS in GMT and then in GMT+1 when we are in BST in the UK?



Maybe add a php setting in ~/.php/5.4/phprc ?

I just went through this, and it depends which “component” you re talking about. mysql, php, command-line etc…

Basically, the VPS knows what time it is (in UTC/GMT/Zulu whatever you want to call it). This time will probably be sync’d (via ntp) with lots of other hosts on the internet. Note that so far, timezones don’t really come in to it.

But then you start a bash prompt and run “date”. Or you connect to mysqld (mysql server) and ask “now()”. Or you ask mysqld to show you (or store) a value of type “datetime” or of type “timestamp”. Or you ask for the time in some php code (so the php interpreter has to answer, and it could be running in standalone mode, in mod_php (apache) or perhaps in the suphp environment). Finally, you might be looking at phpmyadmin, and seeing dates there too.

A good place to start is to ensure that the file /etc/timezone (ssh to your server and type "cat /etc/timezone) has something sensible in it (for you, Europe/London). Note that this takes care of BST/GMT transitions automatically (spring forward, fall back). If /etc/timezone doesn’t contain something sensible, then run:

sudo dpkg-reconfigure tzdata

Should fix things. You’ll now see that (for example) log files in /var/log now contain entries tagged with times that honour your timezone.

It’s late and I’m off to bed (11:38pm, in Europe/London). Post again if you have problems with other things (mysql/php/etc…) and I might be able to help …

Good luck.