<p>I'm looking for a tool that will take a string, something like "every day at 9:00 am" and convert that into a <code>time.Time</code> object and probably a <code>time.Duration</code> object to denote repetition. I was hoping <a href="https://github.com/dustin/go-humanize">go-humanize</a> would have something like that, but haven't found anything after googling for a bit. </p>
<p>I'm happy to write it myself, sounds like a fun project, but didn't want to repeat effort. </p>
<hr/>**评论:**<br/><br/>GunsKnivesRadios: <pre><p>Same here, I would love to find something like the big nasty behemoth Date::Manip from perl. Stop laughing. </p></pre>bwdezend: <pre><p>There’s some things I hate about Perl. That library is not one of them. </p></pre>1lann: <pre><p>I Googled around a bit and found this: <a href="https://github.com/olebedev/when" rel="nofollow">https://github.com/olebedev/when</a></p>
<p>There really isn't many libraries to do this in Go, there are way more available in JavaScript.</p></pre>TimHugh: <pre><p>I haven't used this (just found it on Google), but it looks promising:
<a href="https://github.com/olebedev/when" rel="nofollow">https://github.com/olebedev/when</a></p></pre>vldo: <pre><p><a href="https://github.com/Shixzie/nlp" rel="nofollow">Shixzie/nlp</a></p>
<p>Seems to <a href="https://github.com/Shixzie/nlp#supported-types" rel="nofollow">support time.Duration</a>. It also has <a href="https://github.com/Shixzie/nlp#usage" rel="nofollow">an example</a> similar to what you're describing.</p>
<p>Found in <a href="https://github.com/avelino/awesome-go#natural-language-processing" rel="nofollow">awesome-go#natural-language-processing</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传