LoL, who would know what your code is?, but this sounds rather like you have the same junk as I encountered. There is quite a bit of confusing stuff around in this arena, and it rather depends on how far you are along the road to Damascus before you see the light and get to sort the fair from the foul. This is why the method I alluded to is so good. It uses two programmes for the job, one to set the time, and the other to use it. This means you are not carrying superfluous code in practical applications, you never have any doubt about what you are doing, and one does not interfere with the other.