in reply to best way to write code

I agree with cowboy the multiple localtimes will cause you grief.

This is a definite case of TMTOWTDI. As long as the way you choose to code works for you, you are blessed. Beware however not all ways of coding a solution to the same problem are equal. Some ways are faster than others. Some ways are more readable than others. Make sure you understand what it is that you are doing and it's ramifications. Experiment with different solutions.