当前位置:网站首页>Time processing in C language (conversion between string and timestamp)
Time processing in C language (conversion between string and timestamp)
2022-06-12 13:29:00 【Boring ah le】
C Time processing in language ( String and timestamp conversion )
// One 、 Convert... To time stamp
//strfmt
void metis_strftime(time_t t, char *pcTime)
{
struct tm *tm_t;
tm_t = localtime(&t);
strftime(pcTime,128,"%F %T",tm_t);
}
// Two 、 Convert a string to a timestamp
long metis_strptime(char *str_time)
{
struct tm stm;
strptime(str_time, "%Y-%m-%d %H:%M:%S",&stm);
long t = mktime(&stm);
return t;
}
边栏推荐
- Redis消息队列重复消费问题
- 关于#SQLite写注册功能时,数据表查询出错#的问题,如何解决?
- How to solve the problem of data table query error when SQLite writes the registration function?
- LeetCode滑动窗口刷题总结
- Successful job hopping Ali, advanced learning
- Implementing tensorflow deep learning framework similarflow with numpy
- JVM runtime parameters
- Realization of Joseph Ring with one-way ring linked list
- C#DBHelper_ FactoryDB_ GetConn
- 5V升压到12.6V的锂电池充电IC芯片方案FS4062B
猜你喜欢

关于#SQLite写注册功能时,数据表查询出错#的问题,如何解决?
![[wechat applet development] Part 1: development tool installation and program configuration](/img/a8/f4dcbde295ba7cf738d878464b3af0.png)
[wechat applet development] Part 1: development tool installation and program configuration

Realization of Joseph Ring with one-way ring linked list

Further understanding of the network

D1 哪吒开发板 了解基本的启动加载流程

Cocoapods的相关知识点

实战 | 巧用位姿解算实现单目相机测距

Implementing tensorflow deep learning framework similarflow with numpy

简历 NFT 平台 TrustRecruit 加入章鱼网络成为候选应用链

看完这一篇就够了,web中文开发
随机推荐
C language implementation of string and memory library functions
看完这一篇就够了,web中文开发
下一个职场演讲PPT的明星,会不会是此刻的你【完美总结】
在 Debian 10 上独立安装MySQL数据库
jsp跳转问题,不能显示数据库数据,并且不能跳转
C#DBHelper_FactoryDB_GetConn
Implementing tensorflow deep learning framework similarflow with numpy
智能垃圾桶语音芯片应用设计方案介绍,WT588F02B-8S
【刷题篇】超级洗衣机
Embedded system hardware composition - embedded system hardware architecture
Deploy opengauss database based on Huawei cloud Kunpeng elastic ECS [Gauss is not a mathematician this time]
Script引入CDN链接提示net::ERR_FILE_NOT_FOUND问题
Bitmap, bloom filter and hash sharding
【云原生 | Kubernetes篇】深入了解Deployment(八)
[wechat applet development] Part 1: development tool installation and program configuration
Successful job hopping Ali, advanced learning
How to solve the problem of data table query error when SQLite writes the registration function?
Chaotic engineering practice of distributed kV storage in station B
Redis message queue repeated consumption
Script import CDN link prompt net:: err_ FILE_ NOT_ Found problem