Skip to content

Commit e50f9f5

Browse files
committed
refactor(TimeHelper): 移除已过时的UTC时间转换方法
清理已标记为过时的方法UtcToUtcDateTime和UtcToLocalDateTime,这些功能已被UtcSecondsToUtcDateTime和UtcSecondsToLocalDateTime替代
1 parent dbf188b commit e50f9f5

File tree

1 file changed

+31
-61
lines changed

1 file changed

+31
-61
lines changed

GameFrameX.Utility/TimeHelper.cs

Lines changed: 31 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
// ==========================================================================================
2-
// GameFrameX 组织及其衍生项目的版权、商标、专利及其他相关权利
3-
// GameFrameX organization and its derivative projects' copyrights, trademarks, patents, and related rights
4-
// 均受中华人民共和国及相关国际法律法规保护。
5-
// are protected by the laws of the People's Republic of China and relevant international regulations.
6-
//
7-
// 使用本项目须严格遵守相应法律法规及开源许可证之规定。
8-
// Usage of this project must strictly comply with applicable laws, regulations, and open-source licenses.
9-
//
10-
// 本项目采用 MIT 许可证与 Apache License 2.0 双许可证分发,
11-
// This project is dual-licensed under the MIT License and Apache License 2.0,
12-
// 完整许可证文本请参见源代码根目录下的 LICENSE 文件。
13-
// please refer to the LICENSE file in the root directory of the source code for the full license text.
14-
//
15-
// 禁止利用本项目实施任何危害国家安全、破坏社会秩序、
16-
// It is prohibited to use this project to engage in any activities that endanger national security, disrupt social order,
17-
// 侵犯他人合法权益等法律法规所禁止的行为!
18-
// or infringe upon the legitimate rights and interests of others, as prohibited by laws and regulations!
19-
// 因基于本项目二次开发所产生的一切法律纠纷与责任,
20-
// Any legal disputes and liabilities arising from secondary development based on this project
21-
// 本项目组织与贡献者概不承担。
22-
// shall be borne solely by the developer; the project organization and contributors assume no responsibility.
23-
//
24-
// GitHub 仓库:https://github.com/GameFrameX
25-
// GitHub Repository: https://github.com/GameFrameX
26-
// Gitee 仓库:https://gitee.com/GameFrameX
27-
// Gitee Repository: https://gitee.com/GameFrameX
28-
// 官方文档:https://gameframex.doc.alianblank.com/
29-
// Official Documentation: https://gameframex.doc.alianblank.com/
30-
// ==========================================================================================
31-
1+
// ==========================================================================================
2+
// GameFrameX 组织及其衍生项目的版权、商标、专利及其他相关权利
3+
// GameFrameX organization and its derivative projects' copyrights, trademarks, patents, and related rights
4+
// 均受中华人民共和国及相关国际法律法规保护。
5+
// are protected by the laws of the People's Republic of China and relevant international regulations.
6+
//
7+
// 使用本项目须严格遵守相应法律法规及开源许可证之规定。
8+
// Usage of this project must strictly comply with applicable laws, regulations, and open-source licenses.
9+
//
10+
// 本项目采用 MIT 许可证与 Apache License 2.0 双许可证分发,
11+
// This project is dual-licensed under the MIT License and Apache License 2.0,
12+
// 完整许可证文本请参见源代码根目录下的 LICENSE 文件。
13+
// please refer to the LICENSE file in the root directory of the source code for the full license text.
14+
//
15+
// 禁止利用本项目实施任何危害国家安全、破坏社会秩序、
16+
// It is prohibited to use this project to engage in any activities that endanger national security, disrupt social order,
17+
// 侵犯他人合法权益等法律法规所禁止的行为!
18+
// or infringe upon the legitimate rights and interests of others, as prohibited by laws and regulations!
19+
// 因基于本项目二次开发所产生的一切法律纠纷与责任,
20+
// Any legal disputes and liabilities arising from secondary development based on this project
21+
// 本项目组织与贡献者概不承担。
22+
// shall be borne solely by the developer; the project organization and contributors assume no responsibility.
23+
//
24+
// GitHub 仓库:https://github.com/GameFrameX
25+
// GitHub Repository: https://github.com/GameFrameX
26+
// Gitee 仓库:https://gitee.com/GameFrameX
27+
// Gitee Repository: https://gitee.com/GameFrameX
28+
// 官方文档:https://gameframex.doc.alianblank.com/
29+
// Official Documentation: https://gameframex.doc.alianblank.com/
30+
// ==========================================================================================
31+
3232
namespace GameFrameX.Utility;
3333

3434
/// <summary>
@@ -1069,21 +1069,6 @@ public static string CurrentDateTimeWithUtcFullString()
10691069
return DateTime.UtcNow.ToString("yyyy-MM-dd-HH-mm-ss.fff K");
10701070
}
10711071

1072-
/// <summary>
1073-
/// UTC 时间戳 转换成UTC时间
1074-
/// </summary>
1075-
/// <param name="utcTimestamp">UTC时间戳,单位秒</param>
1076-
/// <returns>转换后的UTC时间。</returns>
1077-
/// <remarks>
1078-
/// 此方法已过时,请使用UtcSecondsToUtcDateTime替代
1079-
/// 用于保持向后兼容性
1080-
/// </remarks>
1081-
[Obsolete("UtcSecondsToUtcDateTime(long utcTimestampSeconds)代替")]
1082-
public static DateTime UtcToUtcDateTime(long utcTimestamp)
1083-
{
1084-
return UtcSecondsToUtcDateTime(utcTimestamp);
1085-
}
1086-
10871072
/// <summary>
10881073
/// UTC 时间戳 转换成UTC时间
10891074
/// </summary>
@@ -1114,21 +1099,6 @@ public static DateTime UtcMillisecondsToUtcDateTime(long utcTimestampMillisecond
11141099
return DateTimeOffset.FromUnixTimeMilliseconds(utcTimestampMilliseconds).UtcDateTime;
11151100
}
11161101

1117-
/// <summary>
1118-
/// UTC 时间戳 转换成本地时间
1119-
/// </summary>
1120-
/// <param name="utcTimestamp">UTC时间戳,单位秒</param>
1121-
/// <returns>转换后的本地时间。</returns>
1122-
/// <remarks>
1123-
/// 此方法已过时,请使用UtcSecondsToLocalDateTime替代
1124-
/// 用于保持向后兼容性
1125-
/// </remarks>
1126-
[Obsolete("UtcSecondsToLocalDateTime(long utcTimestampSeconds) 代替")]
1127-
public static DateTime UtcToLocalDateTime(long utcTimestamp)
1128-
{
1129-
return UtcSecondsToLocalDateTime(utcTimestamp);
1130-
}
1131-
11321102
/// <summary>
11331103
/// UTC 时间戳 转换成本地时间
11341104
/// </summary>

0 commit comments

Comments
 (0)