揮発性のメモ2

http://d.hatena.ne.jp/iww/

2009-11-22から1日間の記事一覧

ore_ctime

C

#include <stdio.h> #include <unistd.h> #include <time.h> const char *ore_ctime( time_t t ) { static char s[256]; if( t==0 ) t=time(NULL); struct tm *tmp = localtime(&t); strftime( s, sizeof(s), "%Y-%m-%d %H:%M:%S", tmp ); return s; } int main(int argc, char **argv) </time.h></unistd.h></stdio.h>…