Hello,
I need to get only date from the whole date
09/12/2022
If date is 09/12/2022 then bot should take 9.
If date is 12/12/2022 then bot should take 12.
I tried to format it but its giving with zero
Now.ToString(“dd”)
Now.ToString(“d”) and this is not working.
Is there a way to get this date?
Gokul001
(Gokul Balaji)
3
Hi @harshikakhatri269
How about this expression?
DateTime.ParseExact("09/12/2022","dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture).Day

Regards
Gokul
Yoichi
(Yoichi)
4
Hi,
Can you try the following?
Now.ToString("%d")

Regards,
Hello @harshikakhatri269
You can either use Modify Date activity as below or the expression provided below.
DateTime.ParseExact(strVar, "MM/dd/yyyy", Globalization.CultureInfo.InvariantCulture).ToString("dd")

Hello @harshikakhatri269
Try this
Your Expression is Good, Just Add space before “d”
Now.Tostring(" d").trim

DateTime.ParseExact("12/12/2022","dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString(" d").Trim

ppr
(Peter Preuss)
7
date retrieval was mentioned. Is it tried from a string or DateTime.
Unfortunately, your culture / local info is not shared. e.g. European 09/12 could be the 9th December
What was done, and what is the exact not working
have a look on a few samples
with a visual surprise of:
Handled as mentioned above:
@Anil_G thanks, it’s working
1 Like
@Gokul001 its working too.
Thanks for the reply
@Gokul_Jayakumar yes, with space it worked.
system
(system)
Closed
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.