How to add dynamically todays date in Typeinto

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

@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

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 :blush:

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 :slight_smile:
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

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