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. Visual Basic
  4. How do you format the date time to just date?

How do you format the date time to just date?

Scheduled Pinned Locked Moved Visual Basic
databasetutorialquestion
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.
  • M Offline
    M Offline
    Muhammad Fahim Baloch
    wrote on last edited by
    #1

    How do you format the date time to just date? for example, this is what i retrievedd from the database: 12/31/2008 12:00:00 AM, but i just want to show the date and no time.

    F L 2 Replies Last reply
    0
    • M Muhammad Fahim Baloch

      How do you format the date time to just date? for example, this is what i retrievedd from the database: 12/31/2008 12:00:00 AM, but i just want to show the date and no time.

      F Offline
      F Offline
      Fernando Soto
      wrote on last edited by
      #2

      Hi Muhammad; This will display the date only

      ' Simulate date and time from the DB
      Dim dt As DateTime = Now

      ' This will display the date only
      MessageBox.Show(dt.ToString("MM/dd/yyyy"))

      Fernando

      1 Reply Last reply
      0
      • M Muhammad Fahim Baloch

        How do you format the date time to just date? for example, this is what i retrievedd from the database: 12/31/2008 12:00:00 AM, but i just want to show the date and no time.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        No need to ask the same question twice, but 7 minutes apart. If someone doesn't answer the first they ain't going to answer the second.

        Check out the CodeProject forum Guidelines[^]

        L 1 Reply Last reply
        0
        • L Lost User

          No need to ask the same question twice, but 7 minutes apart. If someone doesn't answer the first they ain't going to answer the second.

          Check out the CodeProject forum Guidelines[^]

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          EliottA wrote:

          If someone doesn't answer the first they ain't going to answer the second.

          I'm afraid Fernando has proven you're wrong about that... :laugh:

          Luc Pattyn [Forum Guidelines] [My Articles]


          - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


          L 1 Reply Last reply
          0
          • L Luc Pattyn

            EliottA wrote:

            If someone doesn't answer the first they ain't going to answer the second.

            I'm afraid Fernando has proven you're wrong about that... :laugh:

            Luc Pattyn [Forum Guidelines] [My Articles]


            - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            :doh: fair enough. Point still stands..

            Check out the CodeProject forum Guidelines[^]

            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