Discussion
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
enonsys
IN
Last activity: 13 May 2021 21:12 EDT
Get Day of Week in Full string
Hi,
Pega Provides feasibility to get weekday in Integer. suppose if we want to get String Name?
Example : 11-May-2021 - Pega gives output from weekday function - 3
If we need full string we can use below approaches :
1) FormatDateTime function will help to get Pattern of day in string with (EEEEE)
@(Pega-RULES:DateTime).FormatDateTime("20210511T155844.968 GMT", "EEEEE", "", "")
2) we can write an function, which can have library
Java.time.*
Integer intobject = new Integer(parseDay); int d = intobject.intValue(); d= d-1; DayOfWeek day = DayOfWeek.of(d); return day.name();
Note: Why we are subtracting by 1 is pega weekday will give values from 1 as sunday, java will give 0 as sunday. that is the reason we are subtracting.