Erik said:
I'm using ASP 3.0. I'm taking form contents and dumping it into a text file
on the server.
My question is how to add the TIME to this statement. I create the text file
with the name of file, month, day and year.
I would like to add TIME to it.
-------------------------------------------------------------
set fso = createobject("scripting.filesystemobject")
Set act = fso.CreateTextFile(server.mappath("/data/"&g_filename & "-"&
month(date())& day(date())& year(date()) &".htm"), true)
Here's how I create a timestamp VBScript:
'*
'* Generate Timestamp (ccyymmddhhnnss)
'*
Dim strNOW
strNOW = Now()
Dim arrNOW(5)
arrNOW(0) = DatePart("yyyy", strNOW)
arrNOW(1) = DatePart("m", strNOW)
arrNOW(2) = DatePart("d", strNOW)
arrNOW(3) = DatePart("h", strNOW)
arrNOW(4) = DatePart("n", strNOW)
arrNOW(5) = DatePart("s", strNOW)
Dim intNOW
strNOW = ""
For intNOW = 0 To UBound(arrNOW)
If (arrNOW(intNOW) <= 9) Then arrNOW(intNOW) = "0" & arrNOW(intNOW)
strNOW = strNOW & arrNOW(intNOW)
Next
Thus, you would use:
Set act = fso.CreateTextFile(server.mappath("/data/" & g_filename & "-" &
strNOW & ".htm"), true)
You had "mmddyy" but I prefer this format which allows multiple files to be
sorted chronologically.