Juan_Perez
(Juan Perez)
1
Hi friends, I would like to know the last day of the previous month, considering today.And show that day in a MessageBox.
Example1: If Today is 02/01/2018, then I want to see “01/31/2018”
Example2: If Today is 10/17/2018, then I want to see “09/30/2018”
Do you have a workflow with this? Thank you very much!!
3 Likes
Uemoe
(Konstantin Marushchak)
2
Assign endofpreviousMonth = New datetime(yourdate.Year, yourdate.Month,1).AddDays(-1)
2 Likes
CBlanchard
(Cammaron)
3
On the back of @Uemoe suggestion, if you want to make this automatic then use this:
New datetime(now.Date.Year, now.Date.Month,1).AddDays(-1)
It will output:
![image](https://global.discourse-cdn.com/uipath/original/3X/7/0/703ad42eb8a65b1d0d5a6343ec237c56a319c299.png)
datedisplay.xaml (4.9 KB)
16 Likes
Juan_Perez
(Juan Perez)
4
@Uemoe @CBlanchard Thank you so much friends!! ![:smiley: :smiley:](https://emoji.discourse-cdn.com/twitter/smiley.png?v=12)