簡體   English   中英

全日事件,時區和更新

[英]All-DAy events, Timezones and Update

        ItemId id=null;
        string s = "";
        const string dts = " dd.MM.yyyy HH:mm ";
        if(true) {
            TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time");
            ExchangeService ews = new ExchangeService(ExchangeVersion.Exchange2010, tz);
            ews.AutodiscoverUrl("Alexander@contoso.com");
            Appointment app = new Appointment(ews);
            app.IsAllDayEvent = true;
            app.StartTimeZone = tz;
            app.EndTimeZone = tz;
            app.Start = DateTime.Now;
            app.End = DateTime.Now;
            app.Save(SendInvitationsMode.SendToNone);
            id = app.Id;
            Console.WriteLine(app.Start.ToString(dts));
        }
        if(true) {
            TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time");
            ExchangeService ews = new ExchangeService(ExchangeVersion.Exchange2010, tz);
            ews.AutodiscoverUrl("Alexander@contoso.com");
            Appointment app = Appointment.Bind(ews,id);
            Console.WriteLine(app.Start.ToString(dts));

            app.IsAllDayEvent = true;
            app.StartTimeZone = tz;
            app.EndTimeZone = tz;
            app.Start = DateTime.Now;
            app.End = DateTime.Now;
            app.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToNone);
            Console.WriteLine(app.Start.ToString(dts));
        }
        if (true)
        {
            TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time");
            ExchangeService ews = new ExchangeService(ExchangeVersion.Exchange2010, tz);
            ews.AutodiscoverUrl("Alexander@contoso.com");
            Appointment app = Appointment.Bind(ews, id);
            Console.WriteLine(app.Start.ToString(dts));
        }

控制台輸出為:

 05.05.2014 18:17 
 05.05.2014 00:00 
 05.05.2014 18:17 
 05.05.2014 02:00

因此,創建一個新的全天活動就像一個魅力(比我今天早上的活動更好)。

但是,為什么最后一行是02:00 ,又該如何重寫程序以將00:00 CEST存儲為全天約會開始日期呢?

我不是開發人員,但正在為我們的(Java)開發人員研究此問題。 它看起來像你必須從原來的任命得到所有時區S或你會遇到這個問題......的引用/其他堆棧溢出下面的問題,數5得到它,這是最后一個, 發現:(

  1. 您與詢問此人的人處於同一階段
  2. 更進一步,實際時間正確,但是會議顯示的時區錯誤。
  3. 這個類似的問題沒有答案
  4. 已回答以下版本,但我看不出它的含義:Exchange Server 2007 Service Pack 1(SP1)/ Exchange Server 2010
  5. 這實際上使它正常工作。 在Microsoft論壇上引用此答案

如果這樣可以幫助某人,也許其他人也可以最終被關閉:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM