I know that .NET has a time library that allows you to create a time variable and then print it in several different formats. I would assume that VC++ has the same. Try to play around with the DateTime structure to see if it will do what you need it to. You can find more on MSDN about it.
-Josh