Create folder month and date

Hi as in mention screen shot I am getting date in assign variable sub_Date now I need to create two folder from sub_date one is sub_date i.e year inside this sub_date month for this I am using sub_Date(“yyyy”)+""+sub_date.tostring(“MM”)
how can I got year and month instead of yyyy/mm/

Be carefull when create Files/Folders with Dates (Some special charaters are now allowed).
If you want to get “Year” and “Month” from a Folder Path, use Regular Expressions to get year digits and month (Something Like “path\to\folder[0-9]+{4}[0-9]+{2}\whatever”

as i can see from your screen shot your sub_date variable is generic type… before formatting this value to get year and month… you will need to convert it to date time object… like below
CDate(sub_date.tostring).tostring(“yyyy”) for year and (“MMM”) for month…

just make sure your sub_date is in proper date format

1 Like

image

image

1 Like

@AkshaySandhu thanks bro

@c.ciprian thanks bro