Linux time incorrect

linuxtime

I've a Ruby file which executing creates and XML file and saves it. Every time it does it the time for the file (last modification) is incorrect (1 hour ahead).
I also noticed that cron jobs execute 1 hour later than then should.

When calling date and hwclock in command line I see correct time.
How to fix it?

Best Answer

This is not a clock problem but a time zone problem. For this you have to understand the difference between UTC and local time.

So probably your Ruby script is not able to see the difference or misinterprets the global time zone setting. But to make sure you have to give way more information. So for example if the clock is set to UTC or local time? what is your local time zone or offset to UTC? Which Linux distribution do you use? Read how to configure time zones in your specific Linux distribution.