Giter Club home page Giter Club logo

Comments (1)

lorenzotomasi avatar lorenzotomasi commented on June 14, 2024

Other date and time library like luxon start from the lowest to the greatest unit.
There is no standard for normalising with some AI knowledge, and research I found two option:

  • Conversion to Milliseconds: While straightforward, this method might suffer from precision loss due to floating-point arithmetic. It can be efficient for large duration ranges but may not be ideal for high-precision needs.
  • Unit-by-Unit Cut and Distribute: This approach iterates through units from smallest to largest, performing rounding/truncation and carrying over excess to the next unit. It can be more accurate for shorter durations and finer units but may be less efficient for very large durations.

Other considerations can be:

  • Granularity Level:

If high precision is required, normalization to smaller time units (seconds, milliseconds) may be necessary.
However, this can increase the complexity and computational burden of the process.

  • Contextual Understanding:

Normalization must be consistent with the meaning and usage of the duration in the specific context.
For example, normalizing a flight duration may differ from normalizing an industrial process duration.

  • Computational Efficiency:

Normalization can be a complex operation, especially for long periods of time.
It is important to evaluate the computational impact of normalization and choose an efficient method.

from date-fns.

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.