Files
better-genshin-impact/BetterGenshinImpact/Core/Script/Dependence/ServerTime.cs
2025-09-23 00:59:07 +08:00

19 lines
512 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using BetterGenshinImpact.Helpers;
namespace BetterGenshinImpact.Core.Script.Dependence;
public static class ServerTime
{
/// <summary>
/// 获取服务器时区偏移量
/// </summary>
/// <returns>
/// 以毫秒为单位的偏移量
/// 该值可直接在JavaScript中使用`new Date(Date.now() + offset)`
/// </returns>
public static int GetServerTimeZoneOffset()
{
return (int)ServerTimeHelper.GetServerTimeOffset().TotalMilliseconds;
}
}