Git Product home page Git Product logo

Comments (2)

jbfavre avatar jbfavre commented on July 23, 2024

@HumanUser actually you're right :)

Python time.time() method returns an epoch time in seconds, ie the number of seonds since the 1st of january 1970.
Zabbix requires also an epoch timestamp.

What I wanted to get as default clock value is the current minute, not second, ie 18:34:00 and not 18:34:35, which is more convenient for Zabbix graphs.
That said, I figured out I should use int(time.time()/60)*60 to get the right result :-/

> python
Python 2.7.10 (default, Sep 13 2015, 20:30:50) 
[GCC 5.2.1 20150911] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> print time.time()
1443458075.61
>>> print time.time()/60
24057634.5935
>>> print time.time()/60*60
1443458075.61
>>> print int(time.time()/60*60)
1443458075
>>> print int(time.time()/60)*60
1443458040
>>> print time.ctime(1443458075)
Mon Sep 28 18:34:35 2015
>>> print time.ctime(1443458040)
Mon Sep 28 18:34:00 2015

Thanks for pointing that out, will fix it asap

from python-protobix.

jbfavre avatar jbfavre commented on July 23, 2024

Please leave it open till it's fixed.
Thanks

from python-protobix.

Related Issues (13)

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.