|
-
Jul 25th, 2003, 04:15 PM
#1
Thread Starter
Junior Member
Format Function, Isn't Formatting.
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?
-
Jul 25th, 2003, 04:38 PM
#2
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 .
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|