views:

89

answers:

2

When fetching a list of appointments from GroupWise some of the dates in the retrieved appointment objects do not match the values in GroupWise, in fact they are more than 50 years in the future. For instance in the following method I look for appointments starting on or after 1st Jan 2000 midnight and ending on or before 31st December 2010 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);
    }
}

In my test data all of the appointments are dated within 2 weeks of today but the returned objects are 58 years 3 months 1 day 13 hours and 16 minutes in the future. What is more strange is that this doesn't happen every time you retrieve them!

Has anyone experienced this before and have they found a solution to it?

A: 

Are you running into an issue of 32 bit time? Usually CTIME, 32 bit time, is counted as seconds since Jan 1, 1970, mignight plus one second, GMT. Depending on how it is implemented, it might be a sign integer, which means you can refer to dates before 1970, or it might not be considered as signed, in which case it can go into the second half of a 32 bit space (upper 2 billion).

CTIME signed, runs out in 2037/2038 (Feb 2038? Something like that). CTIME unsigned, in principle should be good for another 68 years? (2038-1970 = 68 years).

Is it possible you are off by 68 years, not 58 years, and that it is a CTIME signed/unsigned conversion somewhere problem?

geoffc
A: 

I have found a solution to this issue. I'm not quite sure why but when loading the data from the List into my data type was causing the data still in the list to get corrupted. By changing it to load into a POCO the issue went away.

irtimaled