uio
(uipath test)
December 23, 2022, 7:52am
1
I want to display the current date .
“todaysdate ” variable is in datetime variable type. The expression I have used to get the current date is “now() ”. Used “ToShortDateString ” to get only the date .
I’m getting the date in “MM.dd.yyyy ” format. How do I get in “dd.MM.yyyy ” format ?
Gokul001
(Gokul Balaji)
December 23, 2022, 7:55am
2
HI @uio
How about this expression
DateTime.ParseExact(StringInput.ToString,"MM.dd.yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd.MM.yyyy")
Regards
Gokul
Gokul001
(Gokul Balaji)
December 23, 2022, 8:01am
3
Hi @uio
Try with this
Now.ToString("dd.MM.yyyy")
Yoichi
(Yoichi)
December 23, 2022, 8:11am
4
Hi,
FYI, another approach:
We can use ModifyDate activity to output formatted date time string, as the following.
Regards,
uio
(uipath test)
December 23, 2022, 8:28am
6
Hi,
It worked. How do I achieve this by using just an expression ?
Gokul001
(Gokul Balaji)
December 23, 2022, 8:28am
7
Hey @uio
You can try with the above expression
uio
(uipath test)
December 23, 2022, 8:31am
8
I want to assign this expression to a variable and it’s type is System.Datetime.
uio
(uipath test)
December 23, 2022, 8:34am
9
Yoichi
(Yoichi)
December 23, 2022, 8:35am
10
Hi,
DateTime variable cannot have format information.
Probably your workflow will be as the following.
Regards,
Gokul001
(Gokul Balaji)
December 23, 2022, 8:38am
11
Hi @uio
Dateval = New DateTime(now.Year,now.Month,now.day)
Dateval | Variable type -> System.DateTime
CDate(Dateval ).ToString("dd.MM.yyyy")
Regards
Gokul
1 Like
system
(system)
Closed
December 26, 2022, 8:44am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.