Sorry mate it was the wrong SYSTEMTIME after that. I think I been working too long lol break for me. It works brilliantly thanks mate. Could you explain to me why you have to minus 1900 and 1 from the month?
It's just that they store some of the data differently. SYSTEMTIME stores the month as a number from 1 to 12 while std::tm stores it as a number from 0 to 11. SYSTEMTIME stores the year like you would expect (starting from 0) but std::tm stores it as the number of years since 1900.