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. Database & SysAdmin
  3. Database
  4. DateTime format

DateTime format

Scheduled Pinned Locked Moved Database
database
4 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.
  • A Offline
    A Offline
    Assaf82
    wrote on last edited by
    #1

    Hello I need to view the data in the datagridview from the table through an sql statment but i don't want the date will be like: "1983-01-01 00:00:00" i want just show:"1983-01-01" or show:"01-01-1983" Thanks in advance

    Assaf

    S S 2 Replies Last reply
    0
    • A Assaf82

      Hello I need to view the data in the datagridview from the table through an sql statment but i don't want the date will be like: "1983-01-01 00:00:00" i want just show:"1983-01-01" or show:"01-01-1983" Thanks in advance

      Assaf

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

      You can done it by convert(varchar,getdate(),101) umesh

      1 Reply Last reply
      0
      • A Assaf82

        Hello I need to view the data in the datagridview from the table through an sql statment but i don't want the date will be like: "1983-01-01 00:00:00" i want just show:"1983-01-01" or show:"01-01-1983" Thanks in advance

        Assaf

        S Offline
        S Offline
        squattyarun
        wrote on last edited by
        #3

        there are two ways to achieve it either from sql server by using Convert(varchar(30),getdate(),101) it will convert your date to desired format. other one is use Format(XXX, "dd MMMM, yyyy") function in .NET ...

        Arun Singh Noida.

        A 1 Reply Last reply
        0
        • S squattyarun

          there are two ways to achieve it either from sql server by using Convert(varchar(30),getdate(),101) it will convert your date to desired format. other one is use Format(XXX, "dd MMMM, yyyy") function in .NET ...

          Arun Singh Noida.

          A Offline
          A Offline
          Andy_L_J
          wrote on last edited by
          #4

          Set: DataGridView.Columns(n).DefaultCellStyle.Format = "dd/MM/yyyy"

          The Fanatical All Black Supporter - Kea Kaha

          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