Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> C#

Giá trị MaxValue của TimeSpan trong C#

TimeSpan.MaxValue là giá trị lớn nhất có thể biểu diễn bởi TimeSpan: ~10,675,199 ngày.

Ví dụ minh họa

using System;

public class Demo
{
    public static void Main()
    {
        Console.WriteLine(TimeSpan.MaxValue);
    }
}

Kết quả đầu ra

10675199.02:48:05.4775807

Định dạng: dd.hh:mm:ss.fffffff (ngày.giờ:phút:giây.microseconds).

Giá trị ticks: TimeSpan.MaxValue.Ticks = 9223372036854775807 (long.MaxValue). TimeSpan lưu trữ ticks (100-nanosecond intervals).