DateTime,但为什么没有Date类? [英] DateTime, but why no Date class?

查看:131
本文介绍了DateTime,但为什么没有Date类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我从来没有真正喜欢使用DateTime类型的时候

9/10倍我只想要存储日期。


我现在遇到的主要问题是我有一些用户控件,我想要

来确定是否有DateTime值我应该只显示

日期或日期和时间。


我认为它在地球上无法确定它是否可以确定什么

意图是DateTime实例?


谢谢

Kev

Hi all

I''ve never really been a fan of always having to use a DateTime type when
9/10 times I only want to store a Date.

The main problem I''ve got now is that I have some user controls and I want
to determine whether the DateTime value I have should be displaying the
date-only or both date and time.

I take it there is no way on this earth that it can be determined what the
intentions are of a DateTime instance?

Thanks
Kev

推荐答案

正确。


由于DateTime值总是有时间,因此无法确定它是否是用$ / b创建的
特定时间00:00或没有时间,以便使用

默认时间00:00。

Mantorok写道:
Correct.

As the DateTime value always has a time, there is no telling if it was
created with the specific time 00:00 or without a time so that the
default time 00:00 was used.
Mantorok wrote:
大家好

我从来没有真正喜欢在
9/10次我只想存储一个日期。

我现在遇到的主要问题是我有一些用户控件,我想确定是否有DateTime值我应该只展示
日期或日期和时间。

我认为,在这个世界上没有任何办法可以确定
意图是什么一个DateTime实例?

Kev
Hi all

I''ve never really been a fan of always having to use a DateTime type when
9/10 times I only want to store a Date.

The main problem I''ve got now is that I have some user controls and I want
to determine whether the DateTime value I have should be displaying the
date-only or both date and time.

I take it there is no way on this earth that it can be determined what the
intentions are of a DateTime instance?

Thanks
Kev



" Mantorok" <毫安****** @ mantorok.com>在消息中写道

新闻:e6 ********** @ newsfeed.th.ifl.net ...
"Mantorok" <ma******@mantorok.com> wrote in message
news:e6**********@newsfeed.th.ifl.net...
我接受了在这个世界上没有办法可以确定DateTime实例的意图是什么?
I take it there is no way on this earth that it can be determined what the
intentions are of a DateTime instance?



http://www.msnewsgroups.net/group/mi...topic6617.aspx


关于框架的一个好处是,如果你不喜欢

开箱即用,只需修改它直到它适合,或延伸

它,或完全创造其他东西并使用它...



http://www.msnewsgroups.net/group/mi...topic6617.aspx

One of the great things about the Framework is that, if you don''t like
something straight out of the box, just modify it till it fits, or extend
it, or create something else entirely and use that...




Mark Rae <毫安** @ markN-O-S-P-A-M.co.uk>在消息中写道

news:Ow ************** @ TK2MSFTNGP05.phx.gbl ...

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:Ow**************@TK2MSFTNGP05.phx.gbl...
" Mantorok" <毫安****** @ mantorok.com>在留言中写道
新闻:e6 ********** @ newsfeed.th.ifl.net ...
"Mantorok" <ma******@mantorok.com> wrote in message
news:e6**********@newsfeed.th.ifl.net...
我拿它有没有办法在这个世界上,可以确定什么是DateTime实例的意图?
I take it there is no way on this earth that it can be determined what
the intentions are of a DateTime instance?



http://www.msnewsgroups.net/group/mi...topic6617.aspx

关于框架的一个好处是,如果你不喜欢开箱即用的东西,只需修改它直到它适合,或者扩展它,或完全创造其他东西并使用它...



http://www.msnewsgroups.net/group/mi...topic6617.aspx

One of the great things about the Framework is that, if you don''t like
something straight out of the box, just modify it till it fits, or extend
it, or create something else entirely and use that...




是的,如果没有办法可以用

现有的课程,这就是让我了解框架的原因,一方面你是b
有天才,另一方面你可能有最简单的问题

被忽视。


除非当然这是一个非常好的理由不是有一个System.Date

班。


Kev



Yeah I''ll have to do that if there is no way it can be done with the
existing class, this is what gets me about the Framework, on one side you
have strokes of genius, on the other you may have the most simplest problem
overlooked.

Unless of course there was a very good reason "not" to have a System.Date
class.

Kev


这篇关于DateTime,但为什么没有Date类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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