Karthick Murugesan (KarthickM6092)
Larsen & Toubro Ltd

Larsen & Toubro Ltd
KarthickM6092 Member since 2020 5 posts
Larsen & Toubro Ltd
Posted: May 11, 2021
Last activity: May 13, 2021
Posted: 11 May 2021 12:22 EDT
Last activity: 13 May 2021 21:12 EDT

Get Day of Week in Full string


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



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.

***Edited by Moderator Marissa to add the Developer Knowledge Share tag***
Pega Platform User Experience Other Industry Lead System Architect Developer Knowledge Share