Hi All,
I would like to search data based on today’s date. If “JAN-03-2023” date is matching in web page i want to filter. How can i create dynamic todays date in Typeinto with “JAN-03-2023” format. Any suggessions please.
Thanks In Advance,
Niranjan
Anil_G
(Anil Gorthi)
January 3, 2024, 3:00am
2
@Niranjan_k
You can use this
Now.ToString("MMM-dd-yyyy").ToUpper
Toupper is used to get JAN normally you get as Jan
And also this is 2024 and not 2023…If you need last year use Now.AddYears(-1).ToString("MMM-dd-yyyy")
Happy New Year
Cheers
mkankatala
(Mahesh Kankatala)
January 3, 2024, 3:04am
3
Hi @Niranjan_k
You can use the below expression to get the today’s data in the required format. Save this in a String Variable and you can use that variable in the Type into activity.
- TodayDate = Now.ToString("MMM-dd-yyyy").ToUpper.Trim
Check the below image for better understanding,
If you want to get the date of last year with today’s date, use the below expression
- TodayDate = Now.AddYears(-1).ToString("MMM-dd-yyyy").ToUpper
Check the below image,
Hope it helps!!
1 Like
Hey @Niranjan_k
A post you might find helpful
Hi All,
My recent post on datatable [All About Datatable- UiPath] (https://forum.uipath.com/t/all-about-datatable-uipath/386445 ) was received well in forum with great feedbacks and many suggested to provide some tutorial on topics which are discussed often in our forum
In regards to that I would like to share the commonly used expression for DATETIME conversion
Let’s get started one by one
1. Get Current Date in string format
Datetime.Now.ToString()
(Output - string type - “dd/MM/yyyy hh:mm…
See here for the full list of Date Time formats and examples:
Cheers
Steve
2 Likes
Hi @Niranjan_k
Try this for Dynamic Todays Date
Now.ToString(“MMM-dd-yyyy”).ToUpper
Return: JAN-03-2024
IF you need Todays Date with the Last Year
Now.AddYears(-1).ToString(“MMM-dd-yyyy”).ToUpper
Return: JAN-03-2023
Hope it will helps you
Cheers!!
1 Like
Hi,
you can use below expression,
DateTime.Now.ToString(“MMM-dd-yyyy”).ToUpper()
1 Like
Thanks a ton all the replyies are working thank you
1 Like
system
(system)
Closed
January 6, 2024, 6:06am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.