rchg.net
当前位置:首页 >> struCt tm linux >>

struCt tm linux

用cstlib函数time,比如 #include #include using namespace std; int main() { int t, h, m, s; t = time( 0 ); t = t % 86400; s = t % 60; t = ( t - s ) / 60; m = t % 60; t = ( t - m ) / 60; h = t; cout

用我写的吧 实测过了的 可以直接使用 void WriteSysLog(char *str) { char buf[512]; long MAXLEN = 10*1024*1024;//10MB time_t timep; FILE *fp = NULL; struct tm *p; time(&timep); p = localtime(&timep); memset(buf,0,sizeof(buf)); spri...

网站首页 | 网站地图
All rights reserved Powered by www.rchg.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com