计算不同 TimezoneOffset 的固定日期

问题描述

在特定事件中,我们的应用程序需要将一封电子邮件放入队列,以便在他们当地时间 10:00 AM 为所有用户发送。

我知道用户 TimezoneOffset(-120、180、60 等),但我不知道如何计算用户相对于服务器本地时间的 10:00 AM

public void EnqueueNotification()
{
    int[] timezones = new[] { -120,180,60 };

    // create the "10:00 AM" for the server
    DateTime serverTime = new DateTime(2021,02,18,10,DateTimeKind.Local);
    serverTime = serverTime.AddDays(1);
    // serverTime = "2021-02-19 10:00"

    foreach (int timezone in timezones)
    {
        // at what time of the server is the "10:00 AM" for the timezone ?
        DateTime localDateTime = ???
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)