标签:summary time static ret 北京 ram long his csharp
/// <summary>
/// 生成10位时间戳
/// </summary>
/// <param name="value">北京时间</param>
/// <returns></returns>
public static long GetTimestamp10bit(this DateTime value)
{
value = value.AddHours(-8);
return new DateTimeOffset(value).ToUnixTimeSeconds();
}
/// <summary>
/// 生成13位时间戳
/// </summary>
/// <param name="value">北京时间</param>
/// <returns></returns>
public static long GetTimestamp13bit(this DateTime value)
{
value = value.AddHours(-8);
return new DateTimeOffset(value).ToUnixTimeSeconds();
}
标签:summary time static ret 北京 ram long his csharp
原文地址:https://www.cnblogs.com/yiyanwei/p/13630978.html