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. displaying date format

displaying date format

Scheduled Pinned Locked Moved ASP.NET
databasequestion
6 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.
  • H Offline
    H Offline
    hurrem
    wrote on last edited by
    #1

    Hi, I'm getting date from SQL table, where it is saved as 7/31/2007 12:00:00 AM I need to show this date as July, 31 2007 without the time. is there any easy way to do that? thanks

    M S B S 4 Replies Last reply
    0
    • H hurrem

      Hi, I'm getting date from SQL table, where it is saved as 7/31/2007 12:00:00 AM I need to show this date as July, 31 2007 without the time. is there any easy way to do that? thanks

      M Offline
      M Offline
      Michael P Scherer
      wrote on last edited by
      #2

      Usually its safest to use the ISO date standard, so yyyy-MM-dd. In your case, that would be 2007-31-07 and I'm pretty sure the 7 has to be preceded by a 0 for it to work properly, let alone for any single-digit number in the date.

      www.socoder.net

      H 1 Reply Last reply
      0
      • M Michael P Scherer

        Usually its safest to use the ISO date standard, so yyyy-MM-dd. In your case, that would be 2007-31-07 and I'm pretty sure the 7 has to be preceded by a 0 for it to work properly, let alone for any single-digit number in the date.

        www.socoder.net

        H Offline
        H Offline
        hurrem
        wrote on last edited by
        #3

        Thanks for reply, but I didn't get you. I'm getting the date as it is and I need to display it on a label in a readable format, i.g., as Oct, 27 2007

        1 Reply Last reply
        0
        • H hurrem

          Hi, I'm getting date from SQL table, where it is saved as 7/31/2007 12:00:00 AM I need to show this date as July, 31 2007 without the time. is there any easy way to do that? thanks

          S Offline
          S Offline
          Sun Rays
          wrote on last edited by
          #4

          Hi, you can check here[^]

          Thanks, Sun Rays To get something you must have to try once. My Articles

          1 Reply Last reply
          0
          • H hurrem

            Hi, I'm getting date from SQL table, where it is saved as 7/31/2007 12:00:00 AM I need to show this date as July, 31 2007 without the time. is there any easy way to do that? thanks

            B Offline
            B Offline
            bhanu12345
            wrote on last edited by
            #5

            hi try this code string a a = your date from sqlserver label.text = DateTime.Parse(a).ToLongDateString(); and let me know Bhanu

            1 Reply Last reply
            0
            • H hurrem

              Hi, I'm getting date from SQL table, where it is saved as 7/31/2007 12:00:00 AM I need to show this date as July, 31 2007 without the time. is there any easy way to do that? thanks

              S Offline
              S Offline
              Sathesh Sakthivel
              wrote on last edited by
              #6

              yourDate.ToShortDateString() use this . Hope this will also help you.

              SSK. Anyone who says sunshine brings happiness has never danced in the rain.

              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