I am running an Amazon EC2 server with Ubunutu and I need the server to be able to get the current time for my system. However, since Daylight Savings the time has been an hour behind (obviously) and I can't work out exactly what the best way is to go about's changing this?
Modern Unix systems run a timezone database and automatically adjust for daylight savings time. You may find a file named something like /etc/timezone
that contains the time zone used by default by programs running on the system. However, the system clock itself will be kept in UTC (aka Greenwich Mean Time in old fashioned terminology) and the presented time is derived from UTC by a library.
If the system clock is accurate, getting the time with the correct time zone is simply a matter of properly setting the right string in the timezone file, and the system will properly present the time with the correct DST adjustment.
If the clock itself is not accurate, setting the time on a modern Unix system is generally done using ntpd -- read the documentation for that -- though virtual machines often already have the time accurately set by the host OS and I wouldn't fiddle with that to start with.