Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a date output file ddmmyy.*

Status
Not open for further replies.

todsmurray

Technical User
Aug 8, 2003
5
0
0
GB
I am having problems with my VB Script I need it to out put the data to a date named file eg ddmmyy.htm I have tried several things but the format function does not work in VB Script as it does in VB any ideas?
 
Just use string manipulation. You can get away with a lot using script:
myDate=Date()
dd=day(myDate)
if len(dd)<2 then
dd=&quot;0&quot; & dd
end if
mm=month(myDate)
if len(mm)<2 then
mm= &quot;0&quot; & mm
end if
yy=year(myDate)
yy=right(yy,2)

myFile= dd&mm&yy&&quot;.htm&quot;
 
What veep said.

Also see this page:
You could recreate VB's format function (details at bottom of that page)..

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top