Created
August 11, 2014 21:44
-
-
Save metallurgix/f19d5e015c431877a3cd to your computer and use it in GitHub Desktop.
Day of the week using Date
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
import java.util.*; | |
String[] days={"Sunday","Monday","Tuesday","Wednesday","Thursday", "Friday","Saturday"}; | |
Calendar cal = Calendar.getInstance(); | |
// Month ranges from 0-11 | |
cal.set(2014,7,11); | |
System.out.println(days[cal.get(cal.DAY_OF_WEEK)-1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment