[英]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得到它,這是最后一個, 我發現:(
如果這樣可以幫助某人,也許其他人也可以最終被關閉:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.