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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Getting only the Date

Getting only the Date

Scheduled Pinned Locked Moved ASP.NET
csharptutorialquestion
5 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.
  • R Offline
    R Offline
    Rajiya
    wrote on last edited by
    #1

    Hi, I want to get only the Date part from the DateTime Field. I dont want the time to be displayed along with the date. How to get it? I am using VB.net and it's a windows application. My code is : Dim grdToDate As String = currentRow.Cells(4).Value Dim gridToDate As String = Format(currentRow.Cells(4).Value, "mm/dd/yyyy") Dim AMCFrmDt As String = Format(AMCFromDate.Value, "mm/dd/yyyy") But it is not giving methe proper result. Thanks, Riz

    G I J H 4 Replies Last reply
    0
    • R Rajiya

      Hi, I want to get only the Date part from the DateTime Field. I dont want the time to be displayed along with the date. How to get it? I am using VB.net and it's a windows application. My code is : Dim grdToDate As String = currentRow.Cells(4).Value Dim gridToDate As String = Format(currentRow.Cells(4).Value, "mm/dd/yyyy") Dim AMCFrmDt As String = Format(AMCFromDate.Value, "mm/dd/yyyy") But it is not giving methe proper result. Thanks, Riz

      G Offline
      G Offline
      gauthee
      wrote on last edited by
      #2

      Check for any method like Date, grdToDate.Date???

      Gautham

      1 Reply Last reply
      0
      • R Rajiya

        Hi, I want to get only the Date part from the DateTime Field. I dont want the time to be displayed along with the date. How to get it? I am using VB.net and it's a windows application. My code is : Dim grdToDate As String = currentRow.Cells(4).Value Dim gridToDate As String = Format(currentRow.Cells(4).Value, "mm/dd/yyyy") Dim AMCFrmDt As String = Format(AMCFromDate.Value, "mm/dd/yyyy") But it is not giving methe proper result. Thanks, Riz

        I Offline
        I Offline
        indian143
        wrote on last edited by
        #3

        Dear Mam, It may work fine I guess, please try it out. And tell me yesterday u have asked for disabling back button. Which was working fine. Please let me know.

        Dim dt As Date = Date.Parse("")
        Dim strDate = dt.Month & "/" & dt.Day & "/" & dt.Year

        Thank you. Regards, Aleem,

        S/W Engineer Akebono Soft Technologies aleem_abdul@akebonosoft.com.

        1 Reply Last reply
        0
        • R Rajiya

          Hi, I want to get only the Date part from the DateTime Field. I dont want the time to be displayed along with the date. How to get it? I am using VB.net and it's a windows application. My code is : Dim grdToDate As String = currentRow.Cells(4).Value Dim gridToDate As String = Format(currentRow.Cells(4).Value, "mm/dd/yyyy") Dim AMCFrmDt As String = Format(AMCFromDate.Value, "mm/dd/yyyy") But it is not giving methe proper result. Thanks, Riz

          J Offline
          J Offline
          Jay_se
          wrote on last edited by
          #4

          Hi, I believe 'mm' format Specifier is for Minute. Try use 'MM' for month instead of 'mm'. Hopefully it gives you the right value

          Regards, Jay :)

          1 Reply Last reply
          0
          • R Rajiya

            Hi, I want to get only the Date part from the DateTime Field. I dont want the time to be displayed along with the date. How to get it? I am using VB.net and it's a windows application. My code is : Dim grdToDate As String = currentRow.Cells(4).Value Dim gridToDate As String = Format(currentRow.Cells(4).Value, "mm/dd/yyyy") Dim AMCFrmDt As String = Format(AMCFromDate.Value, "mm/dd/yyyy") But it is not giving methe proper result. Thanks, Riz

            H Offline
            H Offline
            hhkris4u
            wrote on last edited by
            #5

            this is in c# u convertthis into vb and try this will work, string s=myDT.ToString("dd") if u have msdn in ur pc look for "DateTimeFormatInfo Class"

            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