当前位置:网站首页>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;
}
边栏推荐
- Script import CDN link prompt net:: err_ FILE_ NOT_ Found problem
- Pytoch official fast r-cnn source code analysis (I) -- feature extraction
- Embedded driver design
- [cloud native | kubernetes] learn more about ingress
- Actual combat | realizing monocular camera ranging by skillfully using pose solution
- Pytorch官方Faster R-CNN源代码解析(一)——特征提取
- "New continent" of mobile application going to sea
- Seeking magic square of order n with C language
- Teach you how to create SSM project structure in idea
- 【微信小程序开发】第1篇:开发工具安装及程序配置
猜你喜欢

torch_ About the geometric Mini batch

C#DBHelper_ FactoryDB_ GetConn

leetcode 47. Permutations II 全排列 II(中等)

看完这一篇就够了,web中文开发

torch_geometric mini batch 的那些事

Design virtual network to realize communication between virtual machine instance and external network

How to balance multiple losses in deep learning?

Pytoch official fast r-cnn source code analysis (I) -- feature extraction

Application of list and Dict

442 authors, 100 pages! It took Google 2 years to release the new benchmark big bench | open source
随机推荐
多源BFS问题 模板(附题)
How to adapt the page size when iframe is embedded in a web page
达梦数据库DM8 windows环境安装
嵌入式系统概述2-嵌入式系统组成和应用
关于#SQLite写注册功能时,数据表查询出错#的问题,如何解决?
Unittest framework
Title: Yanghui triangle
创新实训(十)高级界面美化
1004: character triangle
深度学习的多个 loss 是如何平衡的?
Wechat web developer tools tutorial, web development issues
Experience and learning path of introductory deep learning and machine learning
R language Visual facet chart, hypothesis test, multivariable grouping t-test, visual multivariable grouping faceting bar plot, adding significance level and jitter points
torch_geometric mini batch 的那些事
看完这一篇就够了,web中文开发
镜像扫描工具预研
leetcode 47. Permutations II full permutations II (medium)
How to solve the problem of data table query error when SQLite writes the registration function?
The goods are full. You must take this knowledge
STM32F1与STM32CubeIDE编程实例-设备驱动-DHT11温度温度传感器驱动