Question
Amazon
US
Last activity: 12 Sep 2017 21:19 EDT
Is there any OOTB function available to get the month name from current date?
Example - If I use this function today; it should give October
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
@(Pega-RULES:DateTime).FormatDateTime(@(Pega-RULES:DateTime).CurrentDateTime(), "MMMMM", "", "")
This should give you "October'
Citicorp Services India Private Limited
IN
Hi Sumit,
There is an OTTB function "@DateTime.month(pegaRulesDate)" , this will return the numeric values between '0 to 11' . here 0 indicate 'January', etc..
You can create decision rule to set the string values appropriately.
here pegaRulesDate value for today is 20151014 (yyyymmdd)
Please let me know if this helps,
Thanks,
Gowrishankar.
-
venkatesh Miryala Sreelatha Gounipalle
Pegasystems
IN
The same applies to SQL functions if you are referring to report definitions. pxMonthNumber function will give you the number and you can use a control to show the right name based on the number.
-
venkatesh Miryala
Pegasystems Inc.
US
Oh nice! Or just use that control that Rajiv just mentioned. Even better
Thanks.
B.
Virtusa
IN
To see the months in Report you need to write the source with custom Function alias like pxMonthNumber with "Text" return type.
Virtusa
IN
To display Quarterly like Jan-Mar, 2017 or Apr-Jun, 2017, we can add new Function alias as below, with return type "Text",
To display Quarterly like Jan-Mar, 2017 or Apr-Jun, 2017, we can add new Function alias as below, with return type "Text",
-
Sudarshan Reddy Renan Luna
Pegasystems Inc.
US
Adding to the previous response, I think the combination of functions will get you what you need.
@DateTime.month(@DateTime.dateValue(@DateTime.getCurrentDateStamp()))
As mentioned, the function will return an integer. So if you want to actually have the text date set on the property, you'd have to write something like a very simple data transform to set the text based on the value returned.
Thanks.
B.
Accepted Solution
Pegasystems Inc.
IN
@(Pega-RULES:DateTime).FormatDateTime(@(Pega-RULES:DateTime).CurrentDateTime(), "MMMMM", "", "")
This should give you "October'
-
Srujan Kumar Goud Bollipally venkatesh Miryala Sumit Verma
Capgemini Deutschland GmbH
DE
Hint: if your dates are configured as "Date only" properties you must add the term "T000000.000 GMT" to work the function as described above.
Example:
Set. ContractStartMonth equal to (@DateTime.FormatDateTime(.ContractStartDate + "T000000.000 GMT", “MMMMM”, “”,””)
-
Sumit Verma Piumika Bhashani