获取当前系统时间并且转化成有效数据
来源:互联网 发布:30岁男士护肤 知乎 编辑:程序博客网 时间:2024/05/22 23:27
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <time.h>
#include <string.h>
int main()
{
time_t timep;
time(&timep);
int date,h,m,s,y;
FILE *fp=fopen("1.txt","r+");
char week[10],month[5];
fprintf(fp,"%s",ctime((&timep)));
fseek(fp,0,SEEK_SET);
fscanf(fp,"%s %s %d %d:%d:%d %d",week,month,&date,&h,&m,&s,&y);
printf("%s %s %d %d %d %d %d",week,month,date,h,m,s,y);
fclose(fp);
}
#include <stdio.h>
#include <windows.h>
#include <time.h>
#include <string.h>
int main()
{
time_t timep;
time(&timep);
int date,h,m,s,y;
FILE *fp=fopen("1.txt","r+");
char week[10],month[5];
fprintf(fp,"%s",ctime((&timep)));
fseek(fp,0,SEEK_SET);
fscanf(fp,"%s %s %d %d:%d:%d %d",week,month,&date,&h,&m,&s,&y);
printf("%s %s %d %d %d %d %d",week,month,date,h,m,s,y);
fclose(fp);
}
0 0
- 获取当前系统时间并且转化成有效数据
- C语言获取系统当前时间转化成时间字符串
- 在java中取得当前的系统时间并且转化成自己想要的格式
- 在java中取得当前的系统时间并且转化成自己想要的格式
- js获取系统当前时间并且转换成yyyy-MM-dd形式
- js获取当前系统时间后台转化为long型
- js获取当前日期,并且转化为时间格式“yyyy-MM-dd HH:MM:SS”
- C++获取当前时间戳,并转化成格式化时间
- IOS 获取系统版本字符串,并且转化成float类型
- 获取系统当前时间
- 获取当前系统时间
- 获取当前系统时间
- 获取系统当前时间
- 获取系统当前时间
- 获取当前系统时间
- 获取系统当前时间
- 获取系统当前时间
- 获取系统当前时间
- DocStrings
- Smarty学习笔记(一)
- rangeSelector讲讲
- ubuntu14.04+cuda6.5+opencv2.4.9+cuda-convnet2配置
- Raspberry pi,一个好玩的派:第九季 Raspbmc最佳实践
- 获取当前系统时间并且转化成有效数据
- Android 用户界面---样式和主题(Styles and Themes)(一)
- pc端得到微博地址的第二种方法
- Linux下Bluetooth socket编程 (Bluetooth与Socket)
- 讨论printf和cout的参数调用顺序
- Android 用户界面---样式和主题(Styles and Themes)(二)
- 二叉树的遍历(递归与非递归)
- IOS开发中UITableView和UITableViewCell的几种样式
- 修改UITextfield的Placeholder字体的颜色