您的位置:首页 > 编程语言 > C语言/C++

C语言下获取当前时间并格式化成字符串的方法-可用作截图或者录像的文件名

2010-09-02 10:03 417 查看
#include <time.h>

#include <stdlib.h>

#include <stdio.h>

void FormatCurrentTimeString(char* pszCurrTime, int nCurrTimeSize)

{

time_t now;

time(&now);

strftime(pszCurrTime, nCurrTimeSize, "%Y%m%d%H%M%S", localtime(&now));

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: