Skip to content

Instantly share code, notes, and snippets.

@AnnaBoro
Created January 4, 2016 21:26
Show Gist options
  • Save AnnaBoro/b3e66254f09d03dd0755 to your computer and use it in GitHub Desktop.
Save AnnaBoro/b3e66254f09d03dd0755 to your computer and use it in GitHub Desktop.
+ dayOfWeek
package lesson5_8;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
public class MyBirthday {
public static void main(String[] args) {
Calendar d = new GregorianCalendar();
d.set(1982, 03, 23);
Date date = new Date(d.getTimeInMillis());
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy", Locale.ENGLISH);
System.out.println("Birthday: " + sdf.format(date));
SimpleDateFormat sdf2 = new SimpleDateFormat("EEEE", Locale.ENGLISH);
System.out.println(sdf2.format(date));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment