ºìÁªLinuxÃÅ»§
Linux°ïÖú

logÖÐUNIXʱ¼äת»»ÎÊÌâ

·¢²¼Ê±¼ä:2007-09-11 00:03:07À´Ô´:ºìÁª×÷Õß:lication
ÔÚUNIXÏ£¬Ä³Ð©Ó¦ÓóÌÐòÐèҪдlog£¬Ò»°ãlogÖÐÐèÒªÊä³ö¿É¶Á¸ñʽµÄʱ¼ä¡£µ«ÊǸù¾ÝÓ¦ÓóÌÐòÆô¶¯»·¾³µÄʱÇøÉèÖò»Í¬£¬Êä³öµÄʱ¼äÒ²²»Í¬£¬ÎªÁËͳһʱ¼ä£¬¿ÉÒÔд¸ñÁÖÍþÖÎʱ¼ä¡£

time_t t;
struct tm *local;
t = time(NULL);
local = gmtime(&t);

printf(asctime(local));

ΪÁËÈÃÊä³öµÄ×Ö·û´®¶¼ÊÇÓ¢ÎÄ£¬»¹¿ÉÒÔÉèÖÃsetlocale("LC_ALL", "C")
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ