top of page
![](https://static.wixstatic.com/media/ea798a_1e5d4aafb98d429cbcb7a33527d100de~mv2.jpg/v1/fill/w_1920,h_1080,al_c,q_90,enc_avif,quality_auto/ea798a_1e5d4aafb98d429cbcb7a33527d100de~mv2.jpg)
18. TimeSpan 型
TimeSpan 型オブジェクトは、時間間隔を表現するために使用します。以下の例では、日付 date1 と date2 との時間間隔を TimeSpan 型の interval に格納した後、interval の日にち要素の値をテキストとして Programmable Block の Detailed Info に出力します。
DateTime date1 = new DateTime(2010, 1, 1, 8, 0, 15);
DateTime date2 = new DateTime(2010, 8, 18, 13, 30, 30);
TimeSpan interval = date2 - date1;
Echo(interval.Days.ToString());
TimeSpan 型の各プロパティと上の例の interval に対する戻り値を以下にまとめます。
bottom of page