gpt4 book ai didi

c# - GroupWise 约会日期错误,超过 50 年

转载 作者:行者123 更新时间:2023-11-30 22:49:31 25 4
gpt4 key购买 nike

从 GroupWise 获取约会列表时,检索到的约会对象中的某些日期与 GroupWise 中的值不匹配,实际上它们是 50 多年以后的日期。例如,在以下方法中,我查找从 2000 年 1 月 1 日午夜或之后开始到 2010 年 12 月 31 日 23:59:59 或之前结束的约会:-

public List<Appointment2> GetGroupWiseAppointments()
{
Application2Class gwApp = new Application2Class();
Account gwAccount = gwApp.Login(Type.Missing, Type.Missing, LoginConstants.egwPromptIfNeeded, Type.Missing, Type.Missing);
Folder gwCalendar = gwAccount.Calendar;

List<Appointment2> appointments = new List<Appointment2>();

MessageList gwAppointments = gwCalendar.Messages.Find("( APPOINTMENT AND BOX_TYPE = INCOMING AND START_DATE >= 2000/1/1 AT 0:0:0 AND DUEEND_DATE <= 2010/12/31 AT 23:59:59 )");
foreach(Appointment2 gwAppointment in gwAppointments)
{
appointments.Add(gwAppointment);
}
}

在我的测试数据中,所有约会的日期都在今天的 2 周内,但返回的对象是 future 58 年 3 个月 1 天 13 小时 16 分钟。更奇怪的是,并不是每次取回它们时都会发生这种情况!

有没有人以前遇到过这种情况,他们找到解决方案了吗?

最佳答案

我已经找到了解决这个问题的方法。我不太清楚为什么,但是当将数据从列表加载到我的数据类型时,导致仍在列表中的数据被损坏。通过将其更改为加载到 POCO 中,问题就消失了。

关于c# - GroupWise 约会日期错误,超过 50 年,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1098876/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com