- java.time.Instant
- Code :
String time = Instant.now().toString();
System.out.println(time); - Result :
2018-09-26T09:16:09.678Z
- java.time.LocalDateTime
- Code :
String time = LocalDateTime.now().toString();
System.out.println(time); - Result :
2018-09-26T17:16:09.678
- java.time.LocalDate
- Code :
String time = LocalDate.now().toString();
System.out.println(time); - Result :
2018-09-26
沒有留言:
張貼留言