Function for Date in dd-mon-yyyy format

I am not sure whether there is any delivered function to get the date in DD-MON-YYYY format in Peoplesoft.
I use this one.
Function GetDatewithMonth(&InputDate As date) Returns string
Evaluate Month(&InputDate)
When 1
&MonthinWords = "JAN";
Break;
When 2
&MonthinWords = "FEB";
Break;
When 3
&MonthinWords = "MAR";
Break;
When 4
&MonthinWords = "APR";
Break;
When 5
&MonthinWords = "MAY";
Break;
When 6
&MonthinWords = "JUN";
Break;
When 7
&MonthinWords = "JUL";
Break;
When 8
&MonthinWords = "AUG";
Break;
When 9
&MonthinWords = "SEP";
Break;
When 10
&MonthinWords = "OCT";
Break;
When 11
&MonthinWords = "NOV";
Break;
When 12
&MonthinWords = "DEC";
Break;
When-Other
Break;
End-Evaluate;
Return Day(&InputDate) | "-" | &MonthinWords | "-" | Year(&InputDate);
End-Function;

2 comments:

  1. You can use the standard peoplecode function datetimetolocalizedstring. It uses a date and the outputformat as input.

    ReplyDelete
  2. Thanks Joris for the comment.

    ReplyDelete