Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

Assign today's date to a variable using VB Script

Experts,

I have a VB script that i am currently running to copy files from one folder to another. I would like to assign today's date to  variable tday.

I would then like to make a concatatenated variable of the date to be:

YYMMDD   thus today would be 140304

How would I do this in my script.

 I am having a problem just assigning today's date for some reason.  I am running in Windows 7.
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

Try this:
strDate = Format(Date, "YYMMDD")

Open in new window

Avatar of morinia

ASKER

This gives me a type format error
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial