Many thanks for the reply’s.
MentalWhiteNoise and Peso:
I have used both these methods to get the data that I require.
What I was after in this post was to try and work out how the example I posted worked.
After searching through various forums I found a number of ways to calculate the dates and time I required. I came across the example code that I posted on various forums and just couldn't work out how it was supposed to work.