Re: String as Datetime

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 05/26/04


Date: Wed, 26 May 2004 09:34:39 -0400


    I don't think that what you want to do is possible. I don't believe
there is a syntax for representing a date time as a string in code. You
will have to create a string, and then actually execute code to change it
into a DateTime, as others have indicated.

    Hope this helps.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"msnews.microsoft.com" <david_dvali@hotmail.com> wrote in message
news:%23PKT02vQEHA.1620@TK2MSFTNGP12.phx.gbl...
> Hello.
> How can I specify datetime by string?
> In VB.NET I can write by "#" simbol like this:  #10/12/2004 12:00#.
> How can I do it in C#?
>
>


Relevant Pages

  • Re: Passing data between Private Subs
    ... Its up to the developer to determine when/how to execute code. ... Sub Exchange(A As String, B As String) ... Dim strTemp As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Converting a string to multiple search patterns
    ... Get a string, ... > I need to refine it, ... using the construct to execute code at match time. ... Build an alternation of patterns where each pattern includes code ...
    (comp.lang.perl.misc)
  • Re: strucutre outputs
    ... so it cannot execute code in a string. ... control strings if you find that useful, but you cannot use a string ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Double Linked List
    ... 256 characters long identified in the input file F. Each identifier ... string is a string of characters representing the identifier itself. ... the file F which could not be classi ed in the lists NAMES, NUMBERS, ...
    (comp.lang.c)
  • Re: Check all errors in code?
    ... representing 0 and a string that doesn't represent any integer value, ... The atoi function converts the initial portion of the string ... The atoi function returns the converted value. ... it can't invoke undefined behavior if strtol returns 0. ...
    (comp.lang.c)