Unix systems and cousins traditionally store times as UTC, and convert them according to the local timezone settings only for display. On a typical Linux machine, /etc/timezone contains the time zone (such as Pacific/Auckland), and /etc/localtime is a SymLink to a binary file containing information on the standard and the daylight savings offset of that time zone, as well instructions on how to calculate when daylight savings is in effect. In the above-mentioned example it might look like this:
$ ls -l /etc/localtime lrwxrwxrwx 1 root root 33 Apr 22 00:19 /etc/localtime -> /usr/share/zoneinfo/Pacific/Auckland
The SuperUser can use tzselect(8) to change these settings. Make sure it is set correctly! If you have it set to UTC your system time will not reflect your localtime. ntpdate(1) will set the system clock correctly, but the hardware clock will get confused. You can compare these by looking at the output of date(1) and hwclock(8).
On Debian systems /etc/default/rcS contains a UTC variable that decides whether or not the hardware clock is set to UTC. Having it that way and setting UTC=yes is A Good Idea. The best reason you might want to use localtime for your hardware clock is if you dual boot with another OperatingSystem that fiddles with your hardware clock for daylight savings.
The internal representation of UTC time that all Unix systems use is often know as the Unix timestamp. This value is defined as the number of seconds since 00:00.00 01-01-1970. This value is always stored in UTC and when displayed is adjusted via your time zone to display your local time.
Try
date +%s
or
perl -e 'print time() . "\n"'
on a Linux box to see the current Unix timestamp.
date --date="1970-01-01 <unix timetamp> secs UTC"
or
perl -e 'print localtime( <unix timestamp> ) . "\n")
or
perl -e 'print gmtime( <unix timestamp> ) . "\n") # for UTC
will give you a human readable time for a given timestamp.
In PHP/C/etc you can convert a time in localtime to a unix timestamp using the mktime(3) function. PHP Example below
<?php $ts = mktime(11, 49, 00, 10, 17, 2004); echo strftime("%Y-%m-%d %H:%M:%S %Z<br>", $ts); putenv("TZ=UTC"); echo strftime("%Y-%m-%d %H:%M:%S %Z<br>", $ts); ?>
If you run this script you'll get output like this (depending on the TimeZone of your server)
2004-10-17 11:49:00 NZDT 2004-10-16 22:49:00 UTC
A really simple way to find the current time/date somewhere to set the TZ variable to the timezone you're interested in and run date(1):
TZ=Pacific/Auckland date
lib/main.php:944: Notice: PageInfo: Cannot find action page