0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

BizRobo!_日付間の時間を取得について

Posted at

はじめに

コンバータ内にある日付間の時間を取得という機能について、最近学んだことをまとめたいと思います。
日付間の時間を取得とは設定した2つの日付から時間や日数を取得する機能です。

実際に使ってみた

比較日付という変数に日時(2022-10-10 4:00:00)を設定
image.png

コンバータの1つ目で現在の日時(2022-10-17 14:51:50)を取得
image.png

日付間の時間を取得の画面
別の日付(2022-10-10 4:00:00)となり、
テスト入力値はコンバータの1つ前の処理結果(2022-10-17 14:51:50)の差がテスト出力欄に表示されます。
2022-10-10から2022-10-17は7日後のため「7」となっている。
image.png

試しに別の日付を現在の日時に変更すると...

比較日付は先ほどと同じく(2022-10-10 4:00:00)を設定
image.png

コンバータの1つ目で比較日付(2022-10-10 4:00:00)を取得
image.png

日付間の時間を取得の画面
別の日付(2022-10-17 14:51:50)となり、
テスト入力値はコンバータの1つ前の処理結果(2022-10-10 4:00:00)の差がテスト出力欄に表示されます。
2022-10-17から2022-10-10は7日前のため「-7」となっている。
日付間の時間を取得の画面の「符号付きの差を取得」のチェックを外すと「7」がテスト出力欄に表示されます。
image.png

まとめ

日付間の時間を取得の機能は、テスト入力値から別の日付までの差を求める。
「符号付きの差を取得」のチェック有りだとテスト入力値が別の日付を過ぎているとマイナス表記で出力される。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?