Last active
May 20, 2022 06:05
-
-
Save gauravkhuraana/51facfc9a2fc66c0d80231a9bd992ce4 to your computer and use it in GitHub Desktop.
Groovy Script to get the particular day of a week
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I have used this in SOAPUI for Groovy scripting | |
def date = new Date() | |
Calendar calendar = Calendar.getInstance(); | |
calendar.setTime(date); | |
def day = calendar.get(Calendar.DAY_OF_WEEK); | |
def map=[ | |
1:"Sunday", | |
2:"Monday", | |
3:"Tuesday", | |
4:"Wednesday", | |
5:"Thursday", | |
6:"Friday", | |
7:"Saturday"] | |
log.info map[day] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment