Sub test11()
Dim str1 As Variant
str1 = Split(" 2023年8月7日 15時00分 ~ 2024年10月14日 19時10分", "~")
y1 = Left(str1(0), InStr(str1(0), "年") - 1)
m1 = Mid(str1(0), InStr(str1(0), "年") + 1, InStr(str1(0), "月") - InStr(str1(0), "年") - 1)
d1 = Mid(str1(0), InStr(str1(0), "月") + 1, InStr(str1(0), "日") - InStr(str1(0), "月") - 1)
h1 = Mid(str1(0), InStr(str1(0), "日") + 1, InStr(str1(0), "時") - InStr(str1(0), "日") - 1)
min1 = Mid(str1(0), InStr(str1(0), "時") + 1, InStr(str1(0), "分") - InStr(str1(0), "時") - 1)
'MsgBox Str(y1) & Str(m1) & Str(d1) & Str(h1) & Str(min1)
y2 = Left(str1(1), InStr(str1(1), "年") - 1)
m2 = Mid(str1(1), InStr(str1(1), "年") + 1, InStr(str1(1), "月") - InStr(str1(1), "年") - 1)
d2 = Mid(str1(1), InStr(str1(1), "月") + 1, InStr(str1(1), "日") - InStr(str1(1), "月") - 1)
h2 = Mid(str1(1), InStr(str1(1), "日") + 1, InStr(str1(1), "時") - InStr(str1(1), "日") - 1)
min2 = Mid(str1(1), InStr(str1(1), "時") + 1, InStr(str1(1), "分") - InStr(str1(1), "時") - 1)
MsgBox Int(y1) - Int(y2)
If Int(h1) > 9 Then
UTC_h1 = Int(h1) - 9
Else
UTC_h1 = 24 + Int(h1) - 9
UTC_D1 = Int(d1) - 1
End If
If Int(h2) > 9 Then
UTC_h2 = Int(h2) - 9
Else
UTC_h2 = 24 + Int(h2) - 9
UTC_D2 = Int(d2) - 1
End If
Cells(4, 1).Value = Str(y1) & "/" & Format(Int(m1), "00") & "/" & Format(Int(d1), "00") & " " & Format(UTC_h1, "00")
' MsgBox min2
End Sub