N_Qahtani
(N Qahtani)
November 20, 2020, 10:38pm
1
Hey guys
I need to type date on yyyy-mm-dd format
And I’m using DateTime.Now
And it’s gave the wrong date
Actually it types the minutes in mm instead of the month
I need an expression gives me the date in that format without the time
Hope you can help I’m getting stuck
Thanks
1 Like
Hello @N_Qahtani and welcome the community
Try the following:
system.DateTime.Now.ToString(“yyyy-MM-dd”)
Also - check out this link to understand the differences between ‘M’ and ‘m’:
Hopefully this helps
5 Likes
Hi Mate,
Use System.DateTime.now.toString(“yyyy-MM-dd”).
Hope it helps,
Thanks and regards.
1 Like
SamanGuruge
(Palliya Guruge Saman Priyalal)
November 21, 2020, 6:14am
4
@N_Qahtani ,
also you can use
Now.ToShortDateString
Now.ToLongDateString
3 Likes
Srini84
(Srinivas)
November 21, 2020, 6:28am
5
@N_Qahtani
Check as below for your reference
Convert Date & Time Format Tutorial
Hope this helps you
Thanks
Hi @N_Qahtani
Welcome to Uipath Community!
Actually, you are using the correct command that needs only small changes, when you use DateTime.Now its returns date + time
so you need only date , you have to made the expression of frunt as you need (yyyy-mm-dd)
and you can change any position of like (mm-yyyy-dd) will show you the year on middle
Correct code : system.DateTime.Now.ToString(“yyyy-MM-dd”)
Main.xaml (4.3 KB)
Hello use
Datetime.now.tostring(“yyyy-MMM-dd”)
system
(system)
Closed
November 24, 2020, 7:32am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.