Programming Tips - How do I deal with time_t in an _snprintf() ?

Date: 2010mar23 Language: C/C++ Platform: Windows Keywords: 64, i64, bit, print, printf, snprintf, fprintf Q. How do I deal with time_t in an _snprintf() ? A. As of Visual Studio 2005, it is signed 64 bits so do:
char buf[100]; time_t now; now = time(NULL); _snprintf(buf, sizeof(buf), "time=%I64d seconds", now);