Jim, I tried your code(cut-'n'-paste), but I couldn't get it to work...maybe I do something wrong when I create the project, which the code is going to be pasted in.

-Win32 console application

-c++ source file

something wrong with this?

It complains about:
ptr = localtime(<);