Last active
January 4, 2016 21:10
-
-
Save AnnaBoro/043a03ca8604a1ce45d2 to your computer and use it in GitHub Desktop.
Calendar + SimpleDateFormat
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.Date; | |
import java.util.GregorianCalendar; | |
import java.util.Locale; | |
public class MyBirthday { | |
public static void main(String[] args) { | |
GregorianCalendar 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)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment