I have:
VB Code:
strFileName = MyPath & Chr(92) & "activity_" & Format(System.DateTime.Now, "MM-DD-YYYY") & ".csv"
And for some reason the format part is returning:
07-DD-YYYY
And not, 07-25-2003.
I can't seem to figure out what is wrong. Any ideas?
Printable View
I have:
VB Code:
strFileName = MyPath & Chr(92) & "activity_" & Format(System.DateTime.Now, "MM-DD-YYYY") & ".csv"
And for some reason the format part is returning:
07-DD-YYYY
And not, 07-25-2003.
I can't seem to figure out what is wrong. Any ideas?
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim tm As Date = Date.Now.ToLongDateString MessageBox.Show(tm) '/// this returns 25/07/2003 on my system '//////////////////////////////////////////////////////////// '/// now you need to use FormatDateTime if you want to do the vb6 way. MessageBox.Show(FormatDateTime(Now, DateFormat.LongDate)) '/// this returns 25/July/2003. End Sub
obviously in some regions the date shows as 07/25/2003 , but in the UK where i am it's 25/07/2003 .