具有比COleDateTime更宽范围的日期时间类? [英] Datetime Class with Wider Range than COleDateTime?

查看:79
本文介绍了具有比COleDateTime更宽范围的日期时间类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我使用的是Visual C ++ / MFC。看起来COleDateTime是范围最广的类,从1月1日,100日到999年12月31日。但是,现在我正在使用SQL Server,它的日期类型范围更广,即从1月1日到12月31,9999。因此,
是否有这样一个类可以支持如此广泛的范围?

I am using Visual C++/MFC. It seems COleDateTime is the class with the most wide range, from Jan 1, 100 to Dec 31, 9999. However, now I am working with SQL Server and its date type has a wider range, i.e., from Jan 1, 1 to Dec 31, 9999. Therefore, is there such a class that can support such a wide range?

 

谢谢

推荐答案

您好,

据我所知,没有这样的课程支持1年级你需要它们吗?您可以实现自己的日期类。例如,如果您需要1.1.1然后在内部使用COleDateTime,但在年份中使用减去99,那么您的范围从1.1.1
到31.12.9899。这也应该足够了,或者你也需要9900到9999年?

as far as I know there is no such class that supports the years 1 to 100. Do you need them? You can implement your own date class. For example if you need 1.1.1 then use COleDateTime internally but use minus 99 for the year, then you have a range from 1.1.1 to 31.12.9899. This should be sufficient too, or do you need the years 9900 to 9999 too?

问候,Guido


这篇关于具有比COleDateTime更宽范围的日期时间类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆