Results 1 to 2 of 2

Thread: Get Mysql Timestamp to textbox with your own format

Threaded View

  1. #1

    Thread Starter
    Addicted Member acidsnake's Avatar
    Join Date
    Feb 2008
    Posts
    157

    Thumbs up Get Mysql Timestamp to textbox with your own format

    here is my complete code for it

    Code:
    Dim conn As New MySqlConnection(connStr)
                conn.Open()
    
                Dim reader As MySqlDataReader
    
                Dim cmd_date As New MySqlCommand("SELECT timestamp FROM allmessage WHERE status='sent' ORDER BY ID DESC LIMIT 0, 1", conn)
    
                reader = cmd_date.ExecuteReader
    
    
                While reader.Read
    
    
                    Dim i As Date = reader.GetDateTime("timestamp")
                    TextBox2.Text = Format(CDate(i), "yyyy-dd-MM HH:mm:ss")
    
                End While
    
                conn.Close()
    declare this function

    Public Function GetDateTime(ByVal ordinal As Integer) As DateTime

    End Function
    Last edited by acidsnake; Feb 27th, 2013 at 04:06 AM. Reason: correction

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