没有时间.NET日期 - 是有一个,或者我不应该需要吗? [英] .NET Date without Time - is there one, or should I not need one?

查看:211
本文介绍了没有时间.NET日期 - 是有一个,或者我不应该需要吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一些领域建模和未来的跨其中我的脑海里最好的暴露为一个日期,而不是​​一个DateTime属性,没有时间组件。

I'm doing some domain modelling and coming across a property which to my mind would be best exposed as a Date rather than a DateTime, without a time component.

有一个很好的理由,为什么没有这样类型的框架?它被认为是一个足够好的主意,一个日期类型添加到SQL Server。另外,如果有人知道的一个方便的实施日期类,请让我知道!

Is there a good reason why there is no such type in the Framework? It was deemed a good enough idea to add a Date type to SQL Server. Also, if someone knows of a handy implementation of a Date class, please let me know!

推荐答案

没有,没有一个,是的,应该有。

No, there isn't one, and yes, there should be.

我不相信有一个很好的理由以外的其他的日期和时间API在.NET中是不是在我(非常偏颇)看法很不错

I don't believe there's a good reason other than that the date and time API in .NET isn't very good in my (very biased) view.

我工作的一个新的API名为野田佳彦时间其中的确实有一个日期,只类( LocalDate ),但它没有准备好生产呢。它可能已经这样做了,你需要的一切,当然,如果它的的不那么你可以总是要求只是你必须尽早实现的功能,而不是以后...

I'm working on a new API called Noda Time which of course does have a date-only class in (LocalDate) but it's not ready for production yet. It may already do everything you need it to, of course, and if it nearly does then you could always ask for just the features you need to be implemented sooner rather than later...

这篇关于没有时间.NET日期 - 是有一个,或者我不应该需要吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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