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. month Format

month Format

Scheduled Pinned Locked Moved ASP.NET
8 Posts 7 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.
  • J Offline
    J Offline
    Jintal Patel
    wrote on last edited by
    #1

    hi i want to get current month in three letter format .Like my string value return 'Oct'

    Jintal Patel

    R S J P A 5 Replies Last reply
    0
    • J Jintal Patel

      hi i want to get current month in three letter format .Like my string value return 'Oct'

      Jintal Patel

      R Offline
      R Offline
      r a j u u
      wrote on last edited by
      #2

      u can use..select cast(Datename(month,getdate(),varchar(3)) from tablename..it will work.

      Rajendran

      1 Reply Last reply
      0
      • J Jintal Patel

        hi i want to get current month in three letter format .Like my string value return 'Oct'

        Jintal Patel

        S Offline
        S Offline
        soni uma
        wrote on last edited by
        #3

        Try this it help u select cast(Datename(month,getdate()) as varchar(3))

        1 Reply Last reply
        0
        • J Jintal Patel

          hi i want to get current month in three letter format .Like my string value return 'Oct'

          Jintal Patel

          J Offline
          J Offline
          John ph
          wrote on last edited by
          #4

          str = Format(Date.Today, ("MMM"))

          Regards
           - J O H N -


          1 Reply Last reply
          0
          • J Jintal Patel

            hi i want to get current month in three letter format .Like my string value return 'Oct'

            Jintal Patel

            P Offline
            P Offline
            Phil Osborne
            wrote on last edited by
            #5

            This will get the current month for you. The important bit is the ToString("MMM") which formats the month. Create a label control and name it Label1 then add this code: Label1.Text = DateTime.Today.ToString("MMM"); Enjoy.

            P J 2 Replies Last reply
            0
            • P Phil Osborne

              This will get the current month for you. The important bit is the ToString("MMM") which formats the month. Create a label control and name it Label1 then add this code: Label1.Text = DateTime.Today.ToString("MMM"); Enjoy.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              This sounds like the answer of an Eagles/Clapton fan. High 5 for you sir.;)

              Deja View - the feeling that you've seen this post before.

              1 Reply Last reply
              0
              • P Phil Osborne

                This will get the current month for you. The important bit is the ToString("MMM") which formats the month. Create a label control and name it Label1 then add this code: Label1.Text = DateTime.Today.ToString("MMM"); Enjoy.

                J Offline
                J Offline
                Jintal Patel
                wrote on last edited by
                #7

                hi this gives me the some other language text...

                Jintal Patel

                1 Reply Last reply
                0
                • J Jintal Patel

                  hi i want to get current month in three letter format .Like my string value return 'Oct'

                  Jintal Patel

                  A Offline
                  A Offline
                  Ahmad Adnan
                  wrote on last edited by
                  #8

                  System.DateTime.Now.ToString("MMM"); i think it will work. and u can apply it to any other DateTime object regards

                  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