date/time help for a newb

Tomthenewb

New member
Joined
Apr 4, 2007
Messages
2
Programming Experience
Beginner
Hiyas,

I am working with a piece of hardware that generates a system report daily at 3:00 am I need to create a variable that will grab the appropriate textfile and allow me to use it.

this is what the generated filename looks like
Wednesday,April,04,2007,03H00M.txt

This is wht I am using
Dim test1 As String = "C:\Program Files\Sentry\" + FormatDateTime(Now, DateFormat.LongDate) + (",03H00M.txt")
TextBox2.Text = test1

now everything is awesome with the exception of the comma following the month.
I can not for the life of me figure out how to get that comma in there.

Any and all help is greatly appreciated
Also FYI I discussed the comma with the engineer who developed the device and he was quite firm that the comma is there to stay :(
 
Build up each part.
VB.NET:
Dim d As Date = Date.Now
Dim s As String = String.Format("{0},{1},{2},{3},{4}", _
    d.DayOfWeek.ToString, _
    d.ToString("MMMM"), _
    d.ToString("dd"), _
    d.Year, _
    "03Homework.txt")
 
Back
Top