strftime,strptime系统函数
来源:互联网 发布:c语言编程判断素数 编辑:程序博客网 时间:2024/05/16 05:10
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
struct tm *tm_ptr,timestruct;
time_t the_time;
char buf[256];
(void) time(&the_time);
tm_ptr=localtime(&the_time);
strftime(buf,256,"%Y-%m-%d %A %d %B,%I:%S %p",tm_ptr);
printf("strftime gives: %s\n",buf);
strcpy(buf,"Sat 26 July 2003,17:53:24 will do fine");
printf("calling strptime with: %s\n",buf);
tm_ptr=×truct;
//result=strptime(buf,"%a %d %b %Y,%R",tm_ptr);
result=strptime(buf,"%a %d %b %Y,%H:%M:%S",tm_ptr);
printf("strptime consumed up to: %s\n",result);
printf("strptime gives:\n");
printf("date: %02d/%02d/%02d\n",tm_ptr->tm_year%100,tm_ptr->tm_mon+1,tm_ptr->tm_mday);
printf("time: %02d:%02d\n",tm_ptr->tm_hour,tm_ptr->tm_min);
exit(0);
}
- strftime,strptime系统函数
- strptime与strftime函数的使用
- linux 时间格式化函数strftime和strptime使用
- linux 时间格式化函数strftime和strptime使用
- python中datetime模块中strftime/strptime函数
- strftime和strptime使用
- strftime和strptime使用
- Python:time, strftime和strptime
- Python:time, strftime和strptime
- strftime和strptime使用(时间日期的格式控制函数)
- strftime和strptime使用(时间日期的格式控制函数)
- strftime和strptime使用(时间日期的格式控制函数)
- strftime、strptime和stime的使用
- 5.1.8 strftime()和strptime()的使用
- Python中time, strftime和strptime
- linux 系统函数之 localtime, localtime_r, strftime
- strftime ()函数
- strftime函数
- centos官网
- 安装findbugs(MyEclipse8.5)
- 矛与盾:用VB打造驱动级键盘记录器,能过QQ密码框(源码)
- 【Div+Css笔记】 0x03 Css Hack
- 关于"完数 "的一个java程序题
- strftime,strptime系统函数
- lightOj1066--BFS好题
- DCMTK编译
- eclipse中show whitespace characters按钮编辑器中显示导致恶心的乱码
- 堆和栈的区别 包含样例 (被转无数次的文章)
- 在 Windows XP 的 Apache 2.2.9 环境下安装 TWiki 4.2.2
- UIlable UITextField的用法
- asp.net 弹出层编辑
- zoj 3630(tajan)求强连通分量的个数