Tuesday, April 5, 2011

Print current date

#include sys/types.h
#include time.h
{
    char buf[40];time_t tm = time(0);struct tm* ptm = localtime(&tm);
    strftime(buf, 40, "%d-%b-%Y %T", ptm);
    fprintf(stderr,"==> jg: T6 expiration @ %s\n", buf);
 }