The command to set the system time is
date. You need to be root to set the system time.
date sets the time to the given time, not to a relative amount from the current time, because that latter behavior would be pretty pointless. You can build a command that modifies the current time by a relative amount by making a calculation on the output of
date and feeding it back to
date, e.g. (on non-embedded Linux)
date $(date +%m%d%H%M%Y.%S -d '1 hour ago')
Beware that if you're running a timekeeping system such as NTP, changing the clock like this will confuse it. Stop it first.
date sets the system time, not the hardware clock. Under Linux, run
hwclock --systohc to copy the system time to the hardware clock; this is done automatically on a clean shutdown.
If you wanted to see the time in a different timezone, forget all this and set the desired timezone instead. Under Linux, run
tzselect to set the system timezone. To run a program in a different timezone, set the
TZ environment variable, e.g.
If you want to run a program and make it believe that the time is different from what it really is, run it under the program
faketime '1 hour ago' date