Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

return day from date in java

 /*
     * 'findDay' function
     *
     * The function is expected to return a STRING.
     * The function accepts following parameters:
     *  1. INTEGER month
     *  2. INTEGER day
     *  3. INTEGER year
     */

public static String findDay(int month, int day, int year) {
        SimpleDateFormat simpleDateformat = new SimpleDateFormat("EEEE");
        
        Date date = new GregorianCalendar(year, month - 1, day).getTime();
        String dayText = simpleDateformat.format(date);
    
        return dayText.toUpperCase(); 
}
Comment

PREVIOUS NEXT
Code Example
Java :: java set label color 
Java :: sprint jpa properties for application.yml 
Java :: java hashmap for loop 
Java :: how to check if a string is empty or null in Android Studio 
Java :: procedural programming Java code example 
Java :: password encryption and decryption in java 
Java :: char equals java 
Java :: setint java 
Java :: slice array java 
Java :: hanoi tower java 
Java :: java compare strings alphabetically 
Java :: spring boot intellij auto reload 
Java :: Read from text file android studio 
Java :: java 8 filter first 
Java :: create new java swing button 
Java :: object to double java 
Java :: how to crate an array of integers in java 
Java :: java create file if not exists 
Java :: java join list as string 
Java :: language of minecraft 
Java :: String by byte array in java 
Java :: java export image 
Java :: java template string 
Java :: comment in java 
Java :: java double format 
Java :: fill an array with random numbers between 1 and 100 java 
Java :: input char java 
Java :: select in selenium java 
Java :: bytes to string solidity 
Java :: how to change color of progress bar in android 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =