Giter Site home page Giter Site logo

Date/Time Stamp 4 Hours Off about msgkit HOT 4 CLOSED

sicos1977 avatar sicos1977 commented on June 12, 2024
Date/Time Stamp 4 Hours Off

from msgkit.

Comments (4)

Sicos1977 avatar Sicos1977 commented on June 12, 2024

That can be possible, still need to finish some things in this library but the lack of time is the biggest problem :-)

from msgkit.

michaelcoles avatar michaelcoles commented on June 12, 2024

No worries. If it helps it seems to be happening around line 265 in Properties.cs in the AddProperty() method. This line:

            case PropertyType.PT_SYSTIME:
                var fileTime = ((DateTime)obj).ToFileTimeUtc();
                data = BitConverter.GetBytes(fileTime);
                break;

If I change it to this, it works:

            case PropertyType.PT_SYSTIME:
                var fileTime = ((DateTime)obj).ToFileTime();
                data = BitConverter.GetBytes(fileTime);
                break;

The odd thing is that the time conversion to UTC should add +4 hours from my time zone, not subtract 4 hours (I'm in U.S. EST). Looks like that might be a bug in a .NET Framework method.

from msgkit.

Sicos1977 avatar Sicos1977 commented on June 12, 2024

Well I have to look into that. Maybe that I'm doing something wrong in the code.

from msgkit.

michaelcoles avatar michaelcoles commented on June 12, 2024

Your code looks good, it's just that last conversion to UTC that seems to be throwing it off.

from msgkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.