localtime 转换时间

来源:互联网 发布:听歌软件 编辑:程序博客网 时间:2024/06/06 23:52

struct tm * stm = NULL;long ltime = atol("1290140656");stm = localtime(&ltime);printf("Local hour is: %d-%d-%d %d:%d:%d\n",stm->tm_year+1900,stm->tm_mon+1,stm->tm_mday,stm->tm_hour,stm->tm_min,stm->tm_sec);

 

 Local hour is: 2010-10-19 2:7:35

0 0
原创粉丝点击