formating date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I am wanting to use the date and time as a file name that I will create. A
file name can not have "\, /, or -" in the name.

What is the procedure for formating the date to make it show some like
example below?

0110051231.txt
 
Assuming that the 1231 is supposed to be the time in hours and minutes, you
can use:

Format(Now, "mmddyyhhnn") & ".txt"
 
If, as it appears, the value you are tryng to create is mmddyymm
where
01 is the month
10 is the day
05 is the year
12 is the hour
31 is minute
The this will work for you:

strFileName = Format(Now,"mmddyyhhnn") & ".txt"
 
Mark said:
I am wanting to use the date and time as a file name that I will create. A
file name can not have "\, /, or -" in the name.

What is the procedure for formating the date to make it show some like
example below?

0110051231.txt


Could explain what parts of that number come from the
various components of a date?
 
Back
Top