Results 1 to 3 of 3
Hi,
I'm trying to test whether some software that I am using will behave as expected when DST change over occurs. I'm specifically testing it for the GB timezone when ...
- 03-24-2010 #1Just Joined!
- Join Date
- Mar 2010
- Posts
- 4
DST (Daylight Saving Time) change over not working as expected
Hi,
I'm trying to test whether some software that I am using will behave as expected when DST change over occurs. I'm specifically testing it for the GB timezone when it enters British Summer Time (BST) and then reverts to GMT.
From the information I have, BST starts:
Sunday 28 March 01:00 GMT (02:00 BST)
and ends:
Sunday 31 October 02:00 BST (01:00 GMT )
To do this test I wrote a shell script that sets the date, runs the program, checks some logs and then reverts the time.
Entering BST was fairly straight forward as all I had to do was the following:
export TZ=GB
date 032800582010
This set the date to be 28th March and the time to be 00:58 in the GB (GMT) timezone. As expected, the date then rolled forward to 02:00 BST.
However, when I tried to do the same for coming out of BST into GMT, the time did not work out as expected.
export TZ=GB
date 103101582010
Setting the time as above put the time straight into GMT and not BST even though it was two minutes before the time should have rolled-over. However if I put the following:
export TZ=GB
date 103100582010
the date was reported as BST!
How can I setup the time so that I don't have to wait for hour before BST ends?
- 03-24-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
1 - Have you updated your timezone data? Use the command yum update tzdata
2 - See this link for information how to properly set your timezone: How to Change the Timezone in Linux - wikiHow
3 - After you update your tzdata package and have set the timezone properly (if it wasn't already) then you can change the clock and see what happens.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 03-24-2010 #3Just Joined!
- Join Date
- Mar 2010
- Posts
- 4
Ran through the steps you described and I'm still getting the same behaviour however I have found the solution to the problem!
If I set the date using a string as follows:
date -s "Sun Oct 31 01:59:50 BST 2010"
it forces the date to be in BST and hence roll over to GMT at 02:00. I guess the other format didn't explicitly set the timezone so GMT was assumed instead.
Thanks for your help all the same. The Wiki link was very useful.


Reply With Quote