Now, when I run the program, I get these results: 14052002 This is exactly one month ago... I run DATE on my linux box, and it gives me the correct date. Any ideas ?
Yes. Re-read the documentation for localtime carefully. You're adding 1900 to the year, so you're close to getting it right.