If internal_isTurnedOn And Right(LCase(internal_CurrentUser), 8) = "lastname" Then
Dim value: value = CDate(InputBox("enter the date and time (hh:mm)", "please", FormatDateTime(Time, 4)))
' validate the input here
internal_Time = CDate(value)
Else
internal_Time = CDate(Time)
End If
入力ボックスが表示され、入力した値に関係なく、現在時刻が表示されます。 ユーザーが別の値に変更した場合、私はCODEこれはいつも私に現在の時間を与えているのですか
If internal_isTurnedOn And Right(LCase(internal_CurrentUser), 8) = "lastname" Then
Dim value
value = CDate(InputBox("Please enter the time (hh:mm)", "Time Input", FormatDateTime(Now, 4)))
internal_Time = CDate(FormatDateTime(value, 4))
Else
internal_Time = FormatDateTime(Time, 4)
End If
TO
UPDATEがしかし、今、私は正確な時刻を取得していますし、私が変更された値をしたいデフォルトは現在の時刻(表示)のままにしたいが、私は入力したが、秒やAM/PMのような不要なものを追加している。とにかくミリタリーフォーマットで時間を得るには?
ミリタリータイムを取得するには、4行目をinternal_Time = FormatDatetime(CDate(value)、4)に変更してください。 – PaulStock