Giter Club home page Giter Club logo

Comments (1)

vogievetsky avatar vogievetsky commented on June 12, 2024

Ok so I think I know what the confusion is.

$ plyql -h dm -q "SELECT TIME_FLOOR(TIMESTAMP '2016-09-11 12:34.56', 'P1D') as A" --output json
[
  {
    "A": {
      "type": "TIME",
      "value": "2016-09-11T00:00:00.000Z"
    }
  }
]
$ plyql -h dm -q "SELECT TIME_FLOOR(TIMESTAMP '2016-09-11 12:34.56', 'P1D') as A" --timezone America/Los_Angeles --output json
[
  {
    "A": {
      "type": "TIME",
      "value": "2016-09-11T07:00:00.000Z"
    }
  }
]
$ plyql -h dm -q "SELECT TIME_FLOOR(TIMESTAMP '2016-09-11 12:34.56', 'P1D') as A" --timezone Asia/Shanghai --output json
[
  {
    "A": {
      "type": "TIME",
      "value": "2016-09-10T16:00:00.000Z"
    }
  }
]
$ plyql -h dm -q "SELECT TIME_FLOOR(TIMESTAMP '2016-09-11 12:34.56', 'P1D', 'Asia/Shanghai') as A" --output json
[
  {
    "A": {
      "type": "TIME",
      "value": "2016-09-10T16:00:00.000Z"
    }
  }
]

the --timezone parameter is simply there to control the default timezone argument to the time manipulating functions TIME_FLOOR, TIME_BUCKET, TIME_SHIFT, etc

It is (as intended) there to control the timezone of the time manipulation NOT of the time display.
As such select max(__time) from test_table; is not in anyway way affected by the --timezone parameter as it stands. Since it does not use any of the time manipulator functions.

output mode json and mysql gateway always output time in UTC. output mode table (the default) out puts the time in your local timezone regardless of --timezone also (because reasons).

Anyhow @gianm has convinced me that this behavior should be changed to have --timezone affect the display also.

Hence: #69

from plyql.

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.