7
Contributors
8
Replies
35
Views
3 Years
Discussion Span
Last Post by G_Waddell
Featured Replies
  • Dim thisDate1 As Date = Now Debug.Writeline(thisDate1.ToString("dd/mm/yyyy")) Read More

  • note that month part should be in caps "dd/MM/yyyy" small m is for minutes Here is a link: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx Read More

  • As daniel955 says, you should watch that capitalisation, "mm" is actually minutes in VB.NET as in "hh:mm:ss" e.g. "28/10/2013 11:30:44" is "dd/MM/yyyy hh:mm:ss" but if you had converted this date to "dd/mm/yyyy" you would get this string "28/30/2013" (28th day, 30 minutes, year 2013) Read More

  • Dim Date1 As DateTime = DateTime.Now() Debug.Writeline(Date1.ToString("d")) Read More

  • Hi Xerohomicide, Doesn't the .Tostring("d"), (short date) depend on your system locale settings? Read More

  • KimberGariando see earlier postings mm gives minutes not month (MM) Read More

1

As daniel955 says, you should watch that capitalisation, "mm" is actually minutes in VB.NET as in "hh:mm:ss" e.g. "28/10/2013 11:30:44" is "dd/MM/yyyy hh:mm:ss" but if you had converted this date to "dd/mm/yyyy" you would get this string "28/30/2013" (28th day, 30 minutes, year 2013)

2

Hi Xerohomicide,

Doesn't the .Tostring("d"), (short date) depend on your system locale settings?

0

Sub Main()

    ' Use current time.


' ... Use a format.
' ... Write to console.
Dim time As DateTime = DateTime.Now
Dim format As String = "MMM ddd d HH:mm yyyy"
Console.WriteLine(time.ToString(format))
End Sub

May Tue 18 16:46 2010

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.