Hello!
I want to write a file and save it as “upload july 19th Part 1”. “upload” and “Part 1” is fixed… But how can i get the date in a form like this? The date changes every week
Hello!
I want to write a file and save it as “upload july 19th Part 1”. “upload” and “Part 1” is fixed… But how can i get the date in a form like this? The date changes every week
Yah @Loons
We can do like this in general
“Yourfilename”+”_”+now.tostring(“dd_MMM_yy”)+”.yourfileextension”
To be exact in what you need
“Yourfilename”+”_”+Now.String(“MMM dd”)+”th”+”_Part1”+”.yourfileextension”
Simple isn’t it @Loons
Cheers
Use this to get the current date in that particular format:
DateTime.Now.ToString("yyyy/MM/dd")
“upload “+date.now.tostring(“MMM dd”)+” th Part1.xyz”
xyz is your file extension…
But when I have for example “july 1st” then “th” isn’t correct.
@Loons
Try this…
"upload "+now.ToString(“MMMM dd”)+“th “+“Part 1”+”.FileExtension”
Fine
in that case this would work, sounds the same but of different format
Cheers @Loons
Hi @Loons,
Try this:
“Upload “+Now.ToString(“MMM dd”)+“th”+” Part 1”
please check the following attachment
make changes as per ur need
Main.xaml (8.7 KB)
Hey @sagaryeole, this looks brilliant. What does the cdate function do? Can see the overall logic (choosing ‘st’, ‘rd’ ‘th’ depending on date) but haven’t seen this function before.
Thanks
Jordan
CDate is use to convert string to Date format.
Hey,
But this would give filename as “11st, 12nd, 13rd Aug” but not “11th, 12th, 13th Aug…”
Hello @Loons I know it is already solved but simple solution to your problem is below…
Main.xaml (6.8 KB)
Ref: Easy Function to add a suffix to a number ie, 1st, 2nd, 3rd, etc..-VBForums
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.