Set DateTime to nothing or 0 0 0 0 0 how? C#


How can I set this DateTime to nothing or zero hours, zero minutes, 0 seconds 

DateTime tempOrgDate

 

Regards,


-- "Mark As Answer" if my reply helped you --
0
sukumarraju
9/22/2008 11:10:58 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

5 Replies
1448 Views

Similar Articles

[PageSpeed] 50
Get it on Google Play
Get it on Apple App Store

 By default a new DateTime starts out at {01/01/0001 00:00:00}

 This is taken from MinValue = {01/01/0001 00:00:00}

 

You cant set it any lower than that. Attempts to will generate a compiler error.

 

The alternative is to declare it as null like:

DateTime tempOrgDate = null;

 

 

0
rtpHarry
9/22/2008 12:03:36 PM

sukumarraju:
How can I set this DateTime to nothing or zero hours, zero minutes, 0 seconds 
 

As far as I know you cant set date time to 0,0,0,0,0,0 . this is not representable in date time case.

You can set it to null - 

DateTime? tempOrgDate = null;


Hope it helps.

-Manas

=======================================
If this post is useful to you, please mark it as answer.
0
yeotumitsu
9/22/2008 12:04:00 PM

rtpHarry:
DateTime tempOrgDate = null;
 

You cant do this. DateTime is value type.

You cant assign null to it.

The variable must be nullable - 

DateTime? tempOrgDate = null; 


Hope it helps.

-Manas

=======================================
If this post is useful to you, please mark it as answer.
0
yeotumitsu
9/22/2008 12:09:25 PM

 Oh yeah, my bad!

0
rtpHarry
9/22/2008 2:37:40 PM

Remember DateTime is a value type so you cant set it to null. However, you can assign it DateTime.MinValue and then consider anything that equals DateTime.MinValue to be null.

DateTime date = DateTime.MinValue;


"Mark As Answer" If my reply helped you --
0
harrifer
9/22/2008 3:00:11 PM
Reply:

Similar Artilces:

0.0.0.0
Can someone tell me the function of this scan? FWIN,2001/08/28,20:06:43 -6:00 GMT,0.0.0.0:800,255.255.255.255:800,UDP "Ben" <notben@home.com> wrote in message news:9mhion$2hf9$1@news.grc.com... > Can someone tell me the function of this scan? > FWIN,2001/08/28,20:06:43 -6:00 GMT,0.0.0.0:800,255.255.255.255:800,UDP Ben, I haven't a clue. 800 TCP mdbs_daemon 800 UDP mdbs_daemon http://www.robertgraham.com/pubs/firewall-seen.html http://www.robertgraham.com/pubs/firewall-seen.html#3.6 http://www.robertgraham.com/pubs/firewall-seen.html#3.2 -- ...

0.0.0.0 ????
Obviously a local IP, but what are its functions/purpose? Thanks for educating the uneducated. In article <MPG.18bf7ade16e851cb989680@news.grc.com>, shr@p.com says... > > > Obviously a local IP, but what are its functions/purpose? > > Thanks for educating the uneducated. > Any available adapter - i.e. not bound to specific IP address. -- Bloated Elvis In article <MPG.18bf7ade16e851cb989680@news.grc.com>, shr@p.com says... > > > Obviously a local IP, but what are its functions/purpose? > > Thanks for educating the une...

63.0.0.0.0/255..0.0.0
Has anyone ever heard of this or know where it goes to.It was asking permission to act as a server? Thanks in advance for any help. "pb" <nothing@nomail.com> wrote in message news:9pa1u4$38b$1@news.grc.com... > Has anyone ever heard of this or know where it goes to.It was asking > permission to act as a server? Thanks in advance for any help. If it shows in your firewall log, can you post a copy of it? -- � -- Robert grc.com forum FAQ - http://grc.com/discussions.htm grc.com forum quick reference - http://grc.com/nntpquickref.htm grc.com forum disclaim...

IP Address 0.0.0.0.0
Some Agent which crosses proxy (MS ISA proxy) are register to the database with 0.0.0.0. When the agent send a request to the server for register, the field ContactAddress has 0.0.0.0 .0 The same PC - Agent without passing a proxy (another location) send a good ContactAdress IP when it register to the server. (Proxy or not) how agent defined addresses IP before to send for registration ? (Locally, with a service network, patchlink network) christian Astinx, can you post the agent update log? -- Shaun Pond PatchLink Update Agent.log 2006/10/23 10:45:14.033...

!27.0.0.1 vs. 0.0.0.0
I can use any number of tools to see what ports I have listening and/or connected. But among the *Listening* ports, some are 127.0.0.1 and some are 0.0.0.0. What is the difference between 127.0.0.1 and 0.0.0.0 ? Since I've got both - there MUST be a difference. Thanks, Alan 0.0.0.0 stands for all interfaces (example: yourIPaddress,127.0.0.1-127.254.254.254) 127.0.0.1 stands for local interface only (127.0.0.1) > 0.0.0.0 stands for all interfaces > (example: yourIPaddress,127.0.0.1-127.254.254.254) > > 127.0.0.1 stands for local interface only (127....

0.0.0.0 IP ADRESS
Hi !I cant understanding. why the my pc documets using 0.0.0.0 ip adress out for internet ? expecially inetsvc.exe and I got active ports program. I see that, the some of the xp (server 2003) documents using 0.0.0.0 ip adress... is there anyone for help this subject. ? and our server (they have dedicated server) no giving us any information about their company. anyone can be know that why ? and I checked my pc with netstat - r ! its seem so different information that my adsl information...thanksARKIN Explain your problem better please, would love to help you on this subject.Bryan Samp...

IP address 0.0.0.0
I am curious to find out entries in my router log (Linksys) which have LAN IP of 0.0.0.0 and destination URL/IP of �. Does nayone know what it means? Is this any hacker activity? Sam <nspam@nospam.net> wrote: > I am curious to find out entries in my router log (Linksys) which > have LAN IP of 0.0.0.0 and destination URL/IP of �. Does nayone know > what it means? Is this any hacker activity? http://www.geocities.com/merijn_bellekom/new/netstatan.html -- Robert GRC newsgroup tips - http://www.imilly.com/noregrets.htm List of Lists - http://lists.gpick.com/ Privac...

[ 0.0.3460.0 ]
Gang... I decided to put up today's first build since it incorporates Sparky's really perfect improvement to the Add/Remove dialog. :) -- ________________________________________________________________ Steve. Working on: GRC's DNS Benchmark utility: http://www.grc.com/dev/DNSBench.exe Steve Gibson wrote: > Gang... > > I decided to put up today's first build since it incorporates > Sparky's really perfect improvement to the Add/Remove dialog. > > :) > I had already worked out a bunch of tests and I've found a ...

[PATCH] When is 0 + 0 != 0
A non-existing buffer + a non-existing buffer should be a non-existing buffer, not "", which is really '\0'. Index: string.c =================================================================== RCS file: /home/perlcvs/parrot/string.c,v retrieving revision 1.50 diff -u -r1.50 string.c --- string.c 28 Feb 2002 18:26:07 -0000 1.50 +++ string.c 1 Mar 2002 05:22:54 -0000 @@ -267,7 +265,7 @@ return string_copy(interpreter, b); } else { - return string_make(interpreter, "", 0, NULL, 0, NU...

[ 0.0.3461.0 ]
Gang... Quick fix of increasing the Add/Remove dialog's inter-button spacing to see whether that cures the effect Robin and others found when using the Classic Windows theme. Did that fix it??? <g> -- ________________________________________________________________ Steve. Working on: GRC's DNS Benchmark utility: http://www.grc.com/dev/DNSBench.exe [for the unabridged version, see Steve Gibson post above] > Did that fix it??? <g> That appears to have done the trick. And the increased spacing makes the result look much nice under the ...

0.0.
Name: lethanhnguyen1990@gmail.com Email: lethanhnguyen1990atgmaildotcom Product: Firefox Summary: 0.0. Comments: good Browser Details: Mozilla/5.0 (Windows NT 5.1; rv:2.0b9pre) Gecko/20110107 Firefox/4.0b9pre From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

SOAP shows Host: 0.0.0.0
I have a web service that sometimes will show the host to be 0.0.0.0 in my SOAP. If I reboot the machine it resets back to localhost. It is a major pain to reboot the machine to correct this as it is random. Any help will be awesome. This is driving me crazy.These are a few lines of the SOAPHost: 0.0.0.0 Content-Type: text/xml;charset=utf-8 Content-Length: length   Than you for the help.  I think the problem must be that the IP of the network interface card of that particular machine has been set to 0.0.0.0 Or may be there is an extra NIC on the Machine which isnt conne...

Worm hacker IP = 0.0.0.0
Can I block hacker address 0.0.0.0 with my firewall and still allow my NT 4.0 IIS webserver to function properly on port 80 and 443? TIA Ric Griffy I blocked 0.0.0.0 it some time ago and it has not been a problem with my servers. Firewall could not get any information on the hacker but showed it as critical attempt. "Ric Griffy" <alakevue@tampabay.rr.com> wrote in message news:9j848i$gt3$1@news.grc.com... > Can I block hacker address 0.0.0.0 with my firewall and still allow my NT > 4.0 IIS webserver to function properly on port 80 and 443? > > TI...

0.0.0.0.bootpc -- what's this?
i seem to have a lot of conversation with 0.0.0.0 on all sorts of ports. right now i block it all except for the dns with apparently no ill effects, but what is it? another is KRNL386.EXE which i also block. can i make these things stop? i'm running Win98 with Norton (configured with a catch-all in the trojan list -- i.e. if not specifically allowed somewhere else, block it) -- Greetings! - "michelle" <a@b.com> wrote in message news:a11o5k$28gg$1@news.grc.com... > i seem to have a lot of conversation with 0.0.0.0 on all sorts of ports. > right n...

Web resources about - Set DateTime to nothing or 0 0 0 0 0 how? C# - asp.net.getting-started

Is there a JQuery plugin to convert UTC datetimes to local user timezone?
If I have a tag: &lt;span class="utctime"&gt;2010-01-01 11:30 PM&lt;/span&gt; I would like a jquery script or plug in to convert every utctime ...


Targetprocess 3.7.3: Epic unit for Bug/Story cards, new DateTime functions in Webhook plugin
Webhook plugin supports new DateTime functions AddDays(DateTime date, int days) – Returns a new date with the number of days added. The number ...

Common Pitfalls when working with DateTime’s
In .NET, the DateTime structure provides us wonderful functionality, but this seemingly simple structure can cause a lot of headaches if you ...

Parsing Twitter Date format to .Net DateTime
Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this post on the web showing how to do it. However, ...

C Sharp (programming language) - Wikipedia, the free encyclopedia
(pronounced see sharp ) is a multi-paradigm programming language encompassing strong typing , imperative , declarative , functional , generic ...

1753 - Wikipedia, the free encyclopedia
Language: English Afrikaans አማርኛ العربية Aragonés Asturianu Aymar aru Azərbaycanca বাংলা Bân-lâm-gú Basa Banyumasan Беларуская ‪Беларуская (тарашкевіца)‬ ...

Coded Smorgasbord: Schizophrenic Haiku Comments and More
... writes Malcom StandardResponse UnSubscribeNewsletterUserAccount( string opTinGUID,string email, string sellingRegion, string source, DateTime ...

Limburg.be - Welkom op de site van de provincie Limburg - Welkom_op_de_site_van_de_provincie_Limburg
visit wonen werken leven ontspannen infopunt home op trefwoord contactpersonen wegwijs sitemap print deze pagina Je bent hier: limburg.be Contact ...

Simples Ideias. Por Nando Vieira.
Simples Ideias Siga-me no Twitter Junho/2012 Usando o Vagrant como ambiente de desenvolvimento no Windows http://simplesideias.com.br/usando ...

Resources last updated: 11/28/2015 9:44:22 PM