TimeZone在创建EWS约会时更改为UTC [英] TimeZone change to UTC while creating the Appointment by EWS

查看:214
本文介绍了TimeZone在创建EWS约会时更改为UTC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用EWS 1.2发送约会。在创建或更新约会时,TimeZone无法在通知邮件上显示与ExchangeServer相同的东京标准时间,并且它的TimeZone只显示为UTC。

但是当我创建或更新约会时,TimeZone正在显示使用Outlook。

 

有谁可以帮我解决这个问题?


以下是复制问题的示例代码:

 ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2,TimeZoneInfo.FindSystemTimeZoneById("Tokyo Standard Time")); 
service.Credentials = new NetworkCredential(admEmailAddress,userData.Password);
service.Url = new Uri(" https://exchgtest.com/EWS/Exchange.asmx");

//在他的电子邮箱userAddress中为该用户创建约会。
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress,userAddress);

预约newAppointment = new预约(服务);
newAppointment.Subject =" Test Subject" ;;
newAppointment.Body =" Test Body" ;;
newAppointment.Start = new DateTime(2013,03,27,10,00,0);
newAppointment.End = newAppointment.Start.AddMinutes(30);
newAppointment.RequiredAttendees.Add(" test@exchgtest.com");

//与会者使用UTC时区获取此约会的通知邮件
//以下是与会者收到的通知内容:
//时间:2013年3月27日,星期二7 :00 PM-7:30 PM。 UTC
newAppointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);

//拉现有约会
string itemId = newAppointment.Id.ToString();

约会existingappointment = Appointment.Bind(service,new ItemId(itemId));

//与会者使用UTC时区获取此约会的通知邮件
//以下是与会者收到的通知内容:
//时间:2013年3月27日,星期二7 :00 PM-7:30 PM。 UTC
existingAppointment.Update(ConflictResolutionMode.AlwaysOverwrite,SendInvitationsOrCancellationsMode.SendToAllAndSaveCopy);



解决方案

您好,


您的问题在此论坛中会收到一些建议。我建议你发布

http://social.technet.microsoft .com /论坛/ en-US / exchangevrdevelopment / threads
以获得更好的支持。


祝你有个美好的一天,


Tom


I am using EWS 1.2 to send appointments. On creating or updating an Appointment, TimeZone can not be showing Tokyo Standard Time same as ExchangeServer on notification mail and it's TimeZone just be shown to UTC.
But TimeZone is showing properly When I create or update an Appointment with Outlook.
 
Could anyone help me to fix this issue?

Here is sample code to replicate the issue:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2, TimeZoneInfo.FindSystemTimeZoneById("Tokyo Standard Time"));
service.Credentials = new NetworkCredential(admEmailAddress, userData.Password);
service.Url = new Uri("https://exchgtest.com/EWS/Exchange.asmx");

//Create an appointment for this user in his email box userAddress.
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, userAddress);

Appointment newAppointment = new Appointment(service);
newAppointment.Subject = "Test Subject";
newAppointment.Body = "Test Body";
newAppointment.Start = new DateTime(2013, 03, 27, 10, 00, 0);
newAppointment.End = newAppointment.Start.AddMinutes(30);
newAppointment.RequiredAttendees.Add("test@exchgtest.com");

//Attendees get notification mail for this appointment using UTC timezone
//Here is the notification content received by attendees:
//When: Tuesday, March 27, 2013 7:00 PM-7:30 PM. UTC
newAppointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);

// Pull existing appointment
string itemId = newAppointment.Id.ToString();

Appointment existingAppointment = Appointment.Bind(service, new ItemId(itemId));

//Attendees get notification mail for this appointment using UTC timezone
//Here is the notification content received by attendees:
//When: Tuesday, March 27, 2013 7:00 PM-7:30 PM. UTC
existingAppointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToAllAndSaveCopy);


解决方案

Hi,

You problem will receive few suggestions in this forum. I would recommend you post http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads for better support.

Have a good day,

Tom


这篇关于TimeZone在创建EWS约会时更改为UTC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆