Skip to content

Instantly share code, notes, and snippets.

@metallurgix
Created August 11, 2014 21:44
Show Gist options
  • Save metallurgix/f19d5e015c431877a3cd to your computer and use it in GitHub Desktop.
Save metallurgix/f19d5e015c431877a3cd to your computer and use it in GitHub Desktop.
Day of the week using Date
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