Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. convert datetime to string

convert datetime to string

Scheduled Pinned Locked Moved C#
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ferronrsmith
    wrote on last edited by
    #1

    i want to convert date time to a string representation e.g. 30/12/2009 -- 30 day of December two thousand nine

    Ferron

    B D realJSOPR 3 Replies Last reply
    0
    • F ferronrsmith

      i want to convert date time to a string representation e.g. 30/12/2009 -- 30 day of December two thousand nine

      Ferron

      B Offline
      B Offline
      Bottomless Wisdom
      wrote on last edited by
      #2

      Its very simple... stringVariable = Convert.ToString(MyDate);

      Software Development & Web Development is my addiction. I am a Visual C# 2.0 and ASP.NET 2.0 Developer and working in Visual Studio 2005 using Dot Net Framework 2.0. Email: bottomless.wisdom@hotmail.com Web: http://bottomless-wisdom.spaces.live.com

      1 Reply Last reply
      0
      • F ferronrsmith

        i want to convert date time to a string representation e.g. 30/12/2009 -- 30 day of December two thousand nine

        Ferron

        D Offline
        D Offline
        Dragonfly_Lee
        wrote on last edited by
        #3

        google convert datetime to [^]

        :) I Love KongFu~

        1 Reply Last reply
        0
        • F ferronrsmith

          i want to convert date time to a string representation e.g. 30/12/2009 -- 30 day of December two thousand nine

          Ferron

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          You can either use the Convert object

          string myDateString = Convert.ToString(myDateTimeObject);

          or you can use

          string myDateStr = myDateTimeObject.ToString("yyyyMMdd");

          or you can use

          http://www.google.com

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          F 1 Reply Last reply
          0
          • realJSOPR realJSOP

            You can either use the Convert object

            string myDateString = Convert.ToString(myDateTimeObject);

            or you can use

            string myDateStr = myDateTimeObject.ToString("yyyyMMdd");

            or you can use

            http://www.google.com

            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
            -----
            "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

            F Offline
            F Offline
            ferronrsmith
            wrote on last edited by
            #5

            i tried what you guys suggested and it doesn't seem to be working. What i really want something to convert from the datetime e.g. 12/3/2007 to 12 of December two thousand seven here is my code

            //Convert the value to a string representation
            String mydateString = System.DateTime.Now.ToString("ddMMyyyy");
            lblDATE0.Text = Convert.ToString(mydateString);

            Ferron

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups