有没有人遇到过用任何语言编写的脚本/ cl应用程序,它可以很好地解析人类输入的日期?我希望能够解析,例如:
>“3至4周”
>“2 – 3天”
>“3周到2个月”
最佳答案
ruby的Chronic gem将允许您以自然形式表达日期.
原文链接:https://www.f2er.com/js/429387.html支持表单的一些示例(来自文档)
thursday november summer friday 13:00 mon 2:35 4pm yesterday at 4:00 last friday at 20:00 last week tuesday tomorrow at 6:45pm afternoon yesterday thursday last week 3 years ago 5 months before now 7 hours ago 7 days from now 1 week hence in 3 hours 1 year ago tomorrow