C++获取时间 场景写日志
来源:互联网 发布:2016最好听的网络歌曲 编辑:程序博客网 时间:2024/06/07 01:51
#include "stdafx.h"#include <Windows.h>#include<string>#include<fstream>#include<time.h>using namespace std;int _tmain(int argc, _TCHAR* argv[]){//获取当前日期time_t t = time(0);char tmp[64];strftime(tmp,sizeof(tmp),"%Y%m%d",localtime(&t));ofstream fout;char fileName[100];sprintf(fileName,"D:\\%s_%s.Log","1",tmp); fout.open(fileName,ios::app);if(fout.is_open()){SYSTEMTIME sys_time;GetLocalTime(&sys_time);char msg[100];sprintf(msg,"%4d/%02d/%02d %02d:%02d:%02d.%03d %s%s",sys_time.wYear,sys_time.wMonth,sys_time.wDay,sys_time.wHour,sys_time.wMinute,sys_time.wSecond,sys_time.wMilliseconds,"发起","创建"); fout<<msg<<endl;fout.close();}return 0;}
0 0
- C++获取时间 场景写日志
- C 取时间和写日志
- C写日志文件
- 【C#】写日志方法
- C/C++写日志代码
- C语言写 系统日志
- 【C++】添加写日志类
- C语言写日志功能
- Linux C写日志文件
- c语言获取时间
- c语言获取时间
- c语言获取时间
- c语言获取时间
- C获取时间
- 【C++】获取系统时间
- C语言获取时间
- C语言获取时间
- 获取时间C#、Java
- AI-伪AI 人工智能 alphago
- Linux/Unix/Mac文件存放路径记录
- Java知识五--注解浅析
- Android开发资源获取国内代理
- 优先级队列广搜——坦克大战
- C++获取时间 场景写日志
- 事务的隔离级别理解
- 多日低效率关于$post,$get,$ajax的感悟
- test
- 由常量池 运行时常量池 String intern方法想到的(四)之深入理解intern
- ios开发模仿CocoaChina精选代码使用masonry计算cell的高度总结
- 加油!
- Maven常用命令
- PDM小记