Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
今日から特定の日の残り日数を計算したい。C#で2つの日付の差を計算するには??
(注:この回答は、質問の言い回しが非常に異なっていたときに書かれました)
あなたの日付がDateTimeまたはであると仮定しDateTimeOffsetます。
DateTime
DateTimeOffset
TimeSpan delta = date1 - date2
TimeSpan GetDelta(DateTime d1, DateTime d2) { return (d1 - d2).TotalDays; }