Question
infosys
IN
Last activity: 10 Jan 2019 6:15 EST
Date functions
I have 2 properties StartDate and ExpectedDate of type Date&Time.If I give any date to the StartDate property then the ExpectedDate should be coming Monday 9AM.
For Example if StartDate=02/01/2019 4:50PM then ExpectedDate=07/01/2019 9AM(which is coming Monday)
StartDate=10/01/2019 3:45 PM then ExpectedDate=14/01/2019 9AM(which is coming Monday)
Please help me to solve this issue.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Cognizant
IN
Hi Anusha,
to get specific time you can use @pxGetSpecifiedTimeOnDate(@(Pega-RULES:DateTime).CurrentDateTime(),09,00,0,"").
Thanks & Regards,
Uthra
Coforge DPA
GB
Hi
A high level algorithm to achieve this :
1. Get the current day for the Todays date. (Pega OOTB function can be used)
2. With that Day, find the number of days to add to get next Monday (ex: if Today is Tuesday, then next Monday would be 6th day after that). Since this value is fixed, you can use the Decision table for it,
3. Add that number of days to Current date. This should give you the next Monday.(Pega OOTB function can be used)
Hope it helps.
Regards
Bhavya
-
avinash avi
infosys
IN
Hi Bhavya,
Thank you for your response, if I add days to the current date to get the next Monday date ,I get the Monday date but how can I get the exact Monday 9AM.
If current date=1/9/2019 11:53 AM then if I just add days to this date to get the Monday date,It will return the expected date as 1/14/2019 11:53 AM,
But I want the expected date as 1/14/2019 9:00 AM.
Regards,
Anusha
Bits in Glass
IN
Hi,
Please find the configuration for your requirement:
- Using weekdays function, by passing start date we can get value for current day(i.e SUNDAY=1, SATURDAY=7)
- Create decision table to set value for date add by passing parameter value.
Hi,
Please find the configuration for your requirement:
- Using weekdays function, by passing start date we can get value for current day(i.e SUNDAY=1, SATURDAY=7)
- Create decision table to set value for date add by passing parameter value.
- Using addtoDate function, we can set startdate+dateadd value to end date.
Thanks
Hemalatha
infosys
IN
Hi HemaLatha,
Thank you for your response, if I add days to the current date to get the next Monday date ,I get the Monday date but how can I get the exact Monday 9AM.
If current date=1/9/2019 11:53 AM then if I just add days to this date to get the Monday date,It will return the expected date as 1/14/2019 11:53 AM(which is the coming Monday Date)
But I want the expected date as 1/14/2019 9:00 AM.
Hi HemaLatha,
Thank you for your response, if I add days to the current date to get the next Monday date ,I get the Monday date but how can I get the exact Monday 9AM.
If current date=1/9/2019 11:53 AM then if I just add days to this date to get the Monday date,It will return the expected date as 1/14/2019 11:53 AM(which is the coming Monday Date)
But I want the expected date as 1/14/2019 9:00 AM.
Regards,
Anusha
Accepted Solution
Cognizant
IN
Hi Anusha,
to get specific time you can use @pxGetSpecifiedTimeOnDate(@(Pega-RULES:DateTime).CurrentDateTime(),09,00,0,"").
Thanks & Regards,
Uthra
-
avinash avi kotamreddy vamsi
infosys
IN
Thank you so much, it worked.