回答編集履歴

1

より短かいのを追記

2018/06/14 06:36

投稿

catsforepaw
catsforepaw

スコア5938

test CHANGED
@@ -10,4 +10,10 @@
10
10
 
11
11
  DateTime justHourLast = justHour - new TimeSpan(((justHour.Hour < lastHour) ? 24 : 0) + justHour.Hour - lastHour, 0, 0);
12
12
 
13
+
14
+
15
+ // より短いのを追記しました。
16
+
17
+ DateTime justHourLast2 = justHour - new TimeSpan((24 + justHour.Hour - lastHour) % 24, 0, 0);
18
+
13
19
  ```