c#当前时间怎么转换成时间戳

  • c#当前时间怎么转换成时间戳

    在C#中,可以使用以下代码将当前时间转换为时间戳:DateTime currentTime = DateTime.Now;DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);TimeSpan timeSpan = currentTime.Subtract(unixEpoch);long times

    2024-03-28
    0