Created
January 4, 2016 21:26
-
-
Save AnnaBoro/b3e66254f09d03dd0755 to your computer and use it in GitHub Desktop.
+ dayOfWeek
This file contains hidden or 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
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