Giter Site home page Giter Site logo

start_timestamp and export timestamp about tapo HOT 5 CLOSED

syco avatar syco commented on July 22, 2024
start_timestamp and export timestamp

from tapo.

Comments (5)

mihai-dinculescu avatar mihai-dinculescu commented on July 22, 2024

What timezone are you on?

I think that you might want

_date = datetime.datetime.fromtimestamp(usage.start_timestamp, tz.gettz())

from tapo.

syco avatar syco commented on July 22, 2024

Yes, I'm in GMT+1, but so is the excel file.
So if I change usage.start_timestamp from GTM+1 to GMT to compare it with the date in the excel file I would be comparing GMT with GMT+1.
So is usage.start_timestamp double moved forward?

from tapo.

mihai-dinculescu avatar mihai-dinculescu commented on July 22, 2024

I've done a bit more digging, and you're correct.
The request is made with the date in UTC when it should be in the local timezone.

This doesn't affect the data returned because the Tapo API will always return data from the start of the day in the local time.
But it does mean that the returned start_timestamp is indeed incorrect.

The problem is here. It should be local time, not UTC.

from tapo.

syco avatar syco commented on July 22, 2024

Well, I'm happy enough that the data returned is correct.
I leave it to you to decide if you want to change start_timestamp or not.
Thanks for looking into it.
(Should we close this now that we know what it is? Please do if you want.)

from tapo.

mihai-dinculescu avatar mihai-dinculescu commented on July 22, 2024

I have a fix in progress. It should land soon.

from tapo.

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.