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存储为全天约会开始日期?
答案 0 :(得分:0)
我不是开发人员,但我们(Java)开发人员正在研究这个问题。您似乎必须从原始约会中获得所有时区 s ,否则您将遇到此问题...下面的参考/其他堆栈溢出问题,编号5得到它,那是我找到的最后一个:(
如果这有助于某人,也许其他人也可以最终关闭:)