Commit 294ccb14 authored by 富永 健雄's avatar 富永 健雄

さらにコメントの追記

parent 55995c6b
......@@ -15,7 +15,8 @@ import org.junit.jupiter.api.Test;
class Test1 {
/**
* {@link HttpClient}のサンプル
* {@link HttpClient}のサンプル
* Java11から登場した{@link HttpClient}クラスを使ったHTTP通信のサンプルです
*/
@Test
......@@ -63,12 +64,12 @@ class Test1 {
System.out.printf( "ld = %02d/%02d/%02d\n", ld.getYear(), ld.getMonthValue(), ld.getDayOfMonth() );
System.out.printf( "%s から本日までの日付 = %d日\n",
System.out.printf( "%s から本日までの日付 = %d日\n",
ld.format(DateTimeFormatter.ofPattern("yyyy/MM/dd")),
ChronoUnit.DAYS.between(ld, LocalDate.now()));
LocalDateTime ldt = LocalDateTime.parse("2022-03-13 22:10:00", DateTimeFormatter.ofPattern("yyy-MM-dd HH:mm:ss"));
System.out.println( "2022-3-13 22:10:00LocalDateTime=>"+ ldt.format(DateTimeFormatter.ofPattern("yyy-MM-dd HH:mm:ss")));
System.out.println( "2022-3-13 22:10:00のLocalDateTime=>"+ ldt.format(DateTimeFormatter.ofPattern("yyy-MM-dd HH:mm:ss")));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment