Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading TNEF APPTIME is not correct #245

Closed
Sicos1977 opened this issue May 16, 2016 · 1 comment
Closed

Reading TNEF APPTIME is not correct #245

Sicos1977 opened this issue May 16, 2016 · 1 comment
Labels
bug Something isn't working

Comments

@Sicos1977
Copy link

Hi... just found a little bug. The way you read apptime and systime in your tnef reader should be like this.
You now read apptime and systime as dates from 1-1-1601 and that is only for the systime and not for apptime.

APPTIME: 8 bytes; a 64-bit floating point number in which the whole number part represents the number of days since December 30, 1899, and the fractional part represents the fraction of a day since midnight

                case PropertyType.PT_APPTIME:
                    var oaDate = BitConverter.ToDouble(Data, 0);
                    return DateTime.FromOADate(oaDate);

                case PropertyType.PT_SYSTIME:
                    var fileTime = BitConverter.ToInt64(Data, 0);
                    return DateTime.FromFileTime(fileTime);
jstedfast added a commit that referenced this issue May 17, 2016
Thanks to Sicos1977 for finding this bug and providing a solution

Fixes issue #245
@jstedfast jstedfast added the bug Something isn't working label May 17, 2016
@jstedfast
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants