none
Matching the way Outlook rounds milliseconds of the SentOn property RRS feed

  • Question

  • I have an add-in that prepares summaries of emails received. A client has noticed that in some cases the time as presented in my summary can be a minute different from the time for the same email shown in Outlook.

    Neither Outlook nor my add-in shows milliseconds but there are milliseconds in the DateTime value of the MailItem's SentOn property.

    I use VB.net's SentOn.ToShortDateString and SentOn.ToShortTimeString to create my summary.

    My guess is that Outlook and vb.net use different methods of rounding the milliseconds.

    Does anyone know about this. I would like to be able to have my summary show exactly the same time.


    Mike VE

    Thursday, February 25, 2016 6:25 PM

Answers

  • It's been my experience that Outlook rounds the minute displayed for a time variable based on seconds.  If the seconds component of the time is 0-29 Outlook displays the minute value as it is stored in the variable. If the seconds component of the variable is 30-59 then Outlook displays the minute value rounded up to the next minute.
    Thursday, February 25, 2016 8:32 PM
  • Thanks for the response guys. Both replies were helpful.

    Looking at the emails with OutlookSpy showed that there are a number of times associated with the sending and receiving an email and I was using the wrong one. Having got that right I implemented the rounding as described by RLWA32 and then I got results that tallied with the date and time displayed in the Inbox..


    Mike VE

    Friday, February 26, 2016 10:17 PM

All replies

  • Hello Mike,

    Try to use any low-level property explorer tool for viewing date property values stored in Extended MAPI entities. For example, you may consider using MFCMAPI (free and open-source) or OutlookSpy (shareware). Do you see any differences there?

    Thursday, February 25, 2016 7:18 PM
  • It's been my experience that Outlook rounds the minute displayed for a time variable based on seconds.  If the seconds component of the time is 0-29 Outlook displays the minute value as it is stored in the variable. If the seconds component of the variable is 30-59 then Outlook displays the minute value rounded up to the next minute.
    Thursday, February 25, 2016 8:32 PM
  • Thanks for the response guys. Both replies were helpful.

    Looking at the emails with OutlookSpy showed that there are a number of times associated with the sending and receiving an email and I was using the wrong one. Having got that right I implemented the rounding as described by RLWA32 and then I got results that tallied with the date and time displayed in the Inbox..


    Mike VE

    Friday, February 26, 2016 10:17 PM