DDay iCalendar DTEND(UTC)

发布于 2024-12-25 20:37:35 字数 271 浏览 2 评论 0原文

我有一个 UTC 日期,我想直接在我的 DDay iCalendar 中使用,但我不知道如何告诉图书馆时间是 UTC 时间。我相信这是在我的时间末尾附加 Z 的问题,但我不知道如何指定 DDay 应该带有“Z”后缀:

“Good”iCalendar Date

DTEND:20120110T223000Z

“Bad”iCalendar Date

DTEND:20120119T170000

I have a date in UTC that I would like to use directly in my DDay iCalendar, but I cannot figure out how to tell the library that the time is in UTC. I believe it's a matter of appending a Z at the end of my time, but I can't figure out how to specify DDay should suffix with a "Z":

"Good" iCalendar Date

DTEND:20120110T223000Z

"Bad" iCalendar Date

DTEND:20120119T170000

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晚雾 2025-01-01 20:37:35

我们是这样实现的:

string sValue = DateTime.Now.ToUniversalTime().ToString(@"yyyyMMdd\THHmmss\Z");

This is how we implement it:

string sValue = DateTime.Now.ToUniversalTime().ToString(@"yyyyMMdd\THHmmss\Z");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文