当前位置:网站首页>Two ways to realize time format printing
Two ways to realize time format printing
2022-06-26 08:28:00 【Tonyfield】
utilize Time function to realize time format printing
#include <time.h>
#include <ctype.h>
time_t rawtime;
struct tm timeinfo;
TCHAR szTime[100];
time ( &rawtime );
localtime_s ( &timeinfo, &rawtime );
_tcsftime( szTime,ARRAYSIZE(szTime), _T("%a %Y-%m-%d %X"), &timeinfo);Time format printing is realized by using traditional string printing function
#include <time.h>
#include <ctype.h>
time_t rawtime;
struct tm timeinfo;
TCHAR szTime[100];
time ( &rawtime );
localtime_s ( &timeinfo, &rawtime );
sprintf_s(szTime,ARRAYSIZE(szTime),
"%4d-%02d-%02d %02d:%02d:%02d",
1900+timeinfo.tm_year,
1+timeinfo.tm_mon,
timeinfo.tm_mday,
timeinfo.tm_hour,
timeinfo.tm_min,
timeinfo.tm_sec);
边栏推荐
- HEVC学习之码流分析
- Stream analysis of hevc learning
- [已解决]setOnNavigationItemSelectedListener()被弃用
- Handwritten instanceof underlying principle
- Macro task, micro task, async, await principle of interview
- What is Qi certification Qi certification process
- 1. error using XPath to locate tag
- (4) Independent key
- Necessary protection ring for weak current detection
- Time functions supported in optee
猜你喜欢

鲸会务为活动现场提供数字化升级方案

1GHz active probe DIY

Installation of jupyter

XXL job configuration alarm email notification

Relationship extraction -- casrel

2020-10-17

Quickly upload data sets and other files to Google colab ------ solve the problem of slow uploading colab files

Ora-12514: tns: the listener currently does not recognize the service requested in the connection descriptor

Go language shallow copy and deep copy

Reflection example of ads2020 simulation signal
随机推荐
See which processes occupy specific ports and shut down
Wechat applet beginner level chapter
Macro task, micro task, async, await principle of interview
Use a switch to control the lighting and extinguishing of LEP lamp
JS file message invalid character error
Uploading pictures with FileReader object
loading view时,后面所有东西屏蔽
opencv學習筆記三
Learn signal integrity from zero (SIPI) - (1)
The solution of installing opencv with setting in pycharm
Fabrication of modulation and demodulation circuit
你为什么会浮躁
Database learning notes I
Relevant knowledge of DRF
Read excel table and render with FileReader object
Learning signal integrity from scratch (SIPI) -- 3 challenges faced by Si and Si based design methods
X-VLM多模态模型解读
h5 localStorage
Interpretation of x-vlm multimodal model
Recognize the interruption of 80s51