| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 485 人关注过本帖
标题:一道关于时间函数的C++题 求解!
只看楼主 加入收藏
单调黑白
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2007-10-4
收藏
 问题点数:0 回复次数:1 
一道关于时间函数的C++题 求解!
using standard C++ functions to implement our own DateTime Functions.
1.Make a Class to store and provice method to do date and time operations.
CLF_DateTime
2.Time storage accurate to milli-seconds.
2007-11-04 22:29:54.9987
3.Reture String with specific format(reference to CTime:Format)
e.g.
CLF_DateTime a = CLF_DateTime(2007,11,4,22,29,54,9987);
a.Format("yyyy-mm-dd HH:MM:SS");

output:
2007-11-04 22:29:54
4.Provid rouding
CLF_DateTime a = CLF_DateTime(2007,11,4,22,29,54,9987);
CLF_DateTime b = a.Rounding(MUNUTE);
b will be"2007-11-04 22:30:00.0000"
5.Provide Compare functions
CLF_DateTime a = CLF_DateTime(2007,11,4,22,29,54,9987);
CLF_DateTime b = CLF_DateTime(2007,11,4,22,30,00,0000);
int iresult;

iresult=CLF_DateTime::Compare(a,b,MINUTE,ROUNDING);

Results:
(a>b,iresult=1)
(a=b,iresult=0)
(a<b,iresult=-1)
搜索更多相关主题的帖子: 函数 求解 时间 
2007-11-05 13:07
单调黑白
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2007-10-4
收藏
得分:0 
回复:(单调黑白)一道关于时间函数的C++题 求解!
大家帮帮我啊!!

雕刻单调的人生
2007-11-05 15:23
快速回复:一道关于时间函数的C++题 求解!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039673 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved