How to set file name with contains today date?

Hello, all

I’d like to set file name which contains today date(yyyy-MM-dd) with ‘Sting’ variable.
Can I set like above condition?

[File Name]
It’s changing everyday and always contains today date with yyyy-MM-dd format

Thank you !!

@Dorothy_lee - please try


1 Like

Use Now.ToString("yyyy-MM-dd"). It will give a string with Today’s date. Use it in your file name.

1 Like

@prasath17 hello, Thank you for your reply
I guess my question is not clear… haha. File name has to set like contains today date not only today date. for example, like below.
below script is string array variable so, not … working.
Directory.GetFiles(“C:\P00433_CashReport”,“*.xlsx”).Where(function(d) Path.GetFileName(d).Contains(Now.tostring(“yyyy-MM-dd”)))(0)

@Dorothy_lee - your requirement is not clear again

I see… Humm…
I would like to set stlnGdriveFileName input property like below for example.

Since file name’s date information is dynamically changed everyday, I hopefully get file if the file name contains today date.
[File Name]

  1. AISTMTPRINT : Not change
  2. 2021-05-30 : Changing everyday
    3)- : Changing randomly

Main purpose of this activity, get files which contains today date !

@Dorothy_lee - Please try this…

 Directory.GetFiles(YourFolderpath,"AISTMTPRINT*.xlsx").where(function(d) new FileInfo(d).Name.Contains(now.tostring("yyyy-MM-dd")))(0)

My date is still 29 :wink:, so I have created file with May 29th date and it fetched correctly…


Thank you ~~!!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.