CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Jul 2010
    Posts
    3

    Question datetime - date only

    Hi

    I have a mod.Start datetime value that I want to be displayed like so... Thursday, 15 July 2010


    I am using the following code.....


    Code:
             string modStart;
             modStart = (mod.Start.ToString("dddd, dd MMMM yyyy")); 
    
             if (mod != null)
             {
                return mod.Name + " (" + mod.Reference + ") - " + modStart;
             }
             return "";

    however i get the following error.....

    Compiler Error Message: CS1501: No overload for method 'ToString' takes '1' arguments



    What is wrong?

    I can get the following to work but it returns the date like so...15/07/2010

    ideally i want the date in the other format, above


    Code:
            string modStart;
            modStart = (mod.Start.ToString()); 
            modStart = modStart.Substring(0, 10);

    Please advise, thank you in advance :-)
    Last edited by HanneSThEGreaT; July 22nd, 2010 at 07:26 AM. Reason: Added [CODE] tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured