Results 1 to 2 of 2

Thread: ASP.NET: change date format

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    ASP.NET: change date format

    how can I change my date format to:
    2004-10-22 19:03:33


    @SENT_DT_TM = '' the above date value ''
    I need to pass this date format into my stored procedure so I can use in a datediff(hour, @SENT_DT_TM, DT_TM) function

    Thanks in advance for any help.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    VB Code:
    1. Dim strDate As String = "10/22/2004 19:03:45"
    2.  
    3.         Dim dt As New DateTime
    4.         dt = dt.Parse(strDate)
    5.         MessageBox.Show(dt.ToString("yyyy-MM-dd H:mm:ss"))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width