-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestao1.java
More file actions
25 lines (22 loc) · 816 Bytes
/
Copy pathquestao1.java
File metadata and controls
25 lines (22 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// QUESTÃO 1 JAVA
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.Scanner;
public class questao1{
public static void main(String[] args) throws ParseException {
String Data;
Scanner d = new Scanner(System.in);
Calendar c = Calendar.getInstance();
Locale local = new Locale("pt", "BR");
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
System.out.print("Informe uma data: ");
Data = d.next();
Date dataFormatada = df.parse(Data);
c.setTime(dataFormatada);
SimpleDateFormat nf = new SimpleDateFormat("dd 'de' MMMM' de' yyyy",local);
System.out.println(nf.format(dataFormatada));
}
}