Giter Club home page Giter Club logo

Comments (3)

sfount avatar sfount commented on May 24, 2024

Agreed 👍.

@DedrickEnc @jniles do you think it's worthwhile budgeting ~half a day for
someone to specifically write/ perform tests (E2E/Integration/Unit) on
DATETIME objects vs. DATES and showing that we can have some guarantees
about dates never being misinterpreted between the client/ server/
database? This would mean that 2.X can have this as a guarantee. Unless
this has already been shown within BHIMA.

Excellent suggestion backed with references.

On Wednesday, January 27, 2016, Jonathan Niles [email protected]
wrote:

As part of the bhima 2.X release cycle, I propose we migrate as many
tables as possible to using DATETIME column types instead of DATE for
storing date datapoints. Under this direction, we will design our table
columns following these guidelines:

  • DATE should never be used. It does not store any time information,
    and might result in incorrect dates conversions between JS and SQL.
  • DATETIME should be used for every column that needs to store a JS
    Date() object. The SQL datatype does not convert records from their
    original timezone to UTC (like a TIMESTAMP does), preferring to store them
    in the time zone of the server.
  • TIMESTAMP should be used for every column that needs to know the
    create/update time of the record. This should be seen as information about
    the MySQL row, not the entity the row represents. TIMESTAMPs may help with
    data migrations and analytical tools later on.

It is worth reading the page on MySQL dates [1]. Also useful is this [2]
Stack Overflow discussion (see top two answers).

[1] http://dev.mysql.com/doc/refman/5.7/en/datetime.html.
[2]
http://stackoverflow.com/questions/409286/should-i-use-field-datetime-or-timestamp
.


Reply to this email directly or view it on GitHub
#45.

from bhima.

jniles avatar jniles commented on May 24, 2024

We definitely need integration tests to support this proposition. I'm working on a few, updating @mbayopanda's employee API tests (which register a date of birth), as part of #24. That is probably not enough though.

Another interesting experiment would be to see how large DATEs are compared to DATETIMEs. While I would still recommend using DATETIMEs over DATEs, it would be valuable information to have.

from bhima.

jniles avatar jniles commented on May 24, 2024

Most, if not all, of our dates have been migrated. Closing this.

from bhima.

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.