Skip to main content

Posts

Showing posts with the label Day Name

How to get Day name from date in Siebel eScript

Below function in Siebel eScipt will return the Day from the date. Input: CurrentDate: 08/10/2021 (MM/DD/YYYY) Result: Tuesday var dayName, CurrentDate; dayName = GetWeekDay(CurrentDate);  -- -- GetWeekDay -- -- function GetWeekDay(currentDate) {     var weekDay, sDate, theYear, sDay = "", i = 0;     weekDay = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");     sDate = new Date(currentDate);     theYear = sDate.getFullYear()          while (i < sDate.getDay())     {         i++;         sDay = weekDay[i];     }     return(sDay); }