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?
[Properties]
image

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

Thank you !!

@Dorothy_lee - please try

Now.tostring("yyyy-MM-dd)

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.
Contains(Now.tostring(“yyyy-MM-dd”)

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

  1. AISTMTPRINT : Not change
  2. 2021-05-30 : Changing everyday
    3)-08.19.22.332000 : 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…

2 Likes

Thank you ~~!!!

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