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. Web Development
  3. ASP.NET
  4. from DateTime to Int

from DateTime to Int

Scheduled Pinned Locked Moved ASP.NET
tutorial
7 Posts 5 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.
  • L Offline
    L Offline
    lupin68
    wrote on last edited by
    #1

    Does anyone know how to convert a datetime format(dd/mm/yyyy) to a string (i.e removing the "/") Thx

    M B 2 Replies Last reply
    0
    • L lupin68

      Does anyone know how to convert a datetime format(dd/mm/yyyy) to a string (i.e removing the "/") Thx

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      You mean ToLongTimeString() method ? i.e DateTime.Now.ToLongTimeString() which return a string Mazy
      "One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji

      D 1 Reply Last reply
      0
      • M Mazdak

        You mean ToLongTimeString() method ? i.e DateTime.Now.ToLongTimeString() which return a string Mazy
        "One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji

        D Offline
        D Offline
        David Flores
        wrote on last edited by
        #3

        I think he wants to remove the "/" also. so do this... DateTime.Now.ToLongTimeString().Replace("/", "")

        B 1 Reply Last reply
        0
        • D David Flores

          I think he wants to remove the "/" also. so do this... DateTime.Now.ToLongTimeString().Replace("/", "")

          B Offline
          B Offline
          Bee Master
          wrote on last edited by
          #4

          ToLongTimeString() returns Time not date and moreover it is dependent on local settings. Instead, use format string as follows: - DateTime.Now.ToString("dd MM yyyy"); //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke

          1 Reply Last reply
          0
          • L lupin68

            Does anyone know how to convert a datetime format(dd/mm/yyyy) to a string (i.e removing the "/") Thx

            B Offline
            B Offline
            Bee Master
            wrote on last edited by
            #5

            Use format string as follows: - DateTime.Now.ToString("dd MM yyyy"); //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke

            L 1 Reply Last reply
            0
            • B Bee Master

              Use format string as follows: - DateTime.Now.ToString("dd MM yyyy"); //Start of joke Never comment ur code. If it was hard to write, it should be hard to understand !!! //End of joke

              L Offline
              L Offline
              lupin68
              wrote on last edited by
              #6

              Thanks to all. DateTime.Today.ToString("ddMMyyyy") did the trick!

              S 1 Reply Last reply
              0
              • L lupin68

                Thanks to all. DateTime.Today.ToString("ddMMyyyy") did the trick!

                S Offline
                S Offline
                Sarvesvara BVKS Dasa
                wrote on last edited by
                #7

                just out of curiocity... why would u need this?? There is nothing new under the sun,
                But there are lots of old things we don't know.

                - Ambrose Bierce

                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