I want to display my date like so in VB.NET
2008/01/22 14:23:15
How is this done in code?
This does not give me enough: lblDate.Text = Today.Date
I want to display my date like so in VB.NET
2008/01/22 14:23:15
How is this done in code?
This does not give me enough: lblDate.Text = Today.Date
Try
lblDate.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
This should display the way you want:
Dim formattedDate As String = Date.Today.ToString("yyyy/MM/dd HH:mm:ss")
And see Custom DateTime Format Strings for a complete reference.
This blog post has a good description of how to do string formatting: http://idunno.org/archive/2004/07/14/122.aspx