Question
3
Replies
1853
Views
Virtusa Corporation
Posted: December 17, 2017
Last activity: December 19, 2017
Closed
Solved
Get 1st of every month
Hi,
I have a requirement to get list of records data from 1st of current month to till date.
Can anyone suggest please is there a function i can set 1st of current month date time value to a property.
Thanks.
Hi,
You can use DateTime utility functions for your requirement. One possible way is here.
Get the year and month from current time stamp. Then create a new date with the month and year fetched from current time stamp, and with default the date part to "1". Note that @month utility gives the months in 0-11 format so you need to increment it before passing to Date function.
@(Pega-RULES:DateTime).date(@year(@toDateTime(@CurrentDateTime())),@month(@toDateTime(@CurrentDateTime()))+1,"1")
Thanks,
Santhosh