How to parse relative time?

后端 未结 5 718
花落未央
花落未央 2020-12-18 23:55

This question is the other side of the question asking, \"How do I calculate relative time?\".

Given some human input for a relative time, how can you parse it? By

5条回答
  •  遥遥无期
    2020-12-19 00:16

    The ruby folks have attempted to tackle this with a parser called Chronic.

    • Chronic RDocs
    • Chronic on GitHub

    I watched an informative video presentation recently on how the author went about solving this problem.

    • Chronic Presentation (San Diego Ruby Brigade)

提交回复
热议问题