如何在 Julia 中约会

编程入门 行业动态 更新时间:2024-10-27 15:26:57
本文介绍了如何在 Julia 中约会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我搜索了文档,但找不到获取今天日期的函数.我可能遗漏了一些相当明显的东西.

I search the docs but I cannot find a function to get today's date.I probably am missing something fairly obvious.

我只需要类似的东西

julia> today() 2014-06-25 julia> string(today()) "2014-06-25"

推荐答案

您的精确草图现在可以完全按照您在使用日期之后编写的那样工作.Dates 模块是标准库的一部分,并且因此默认情况下可用:

Your exact sketch now works precisely as you've written it after using Dates. The Dates module is a part of the standard library and thus is available by default:

julia> using Dates julia> today() 2020-08-20 julia> string(today()) "2020-08-20"

(注意:此答案已针对 1.0+ 版本进行了编辑和更新;此问题早于 Dates 标准库的存在.)

(note: this answer has been edited and updated for version 1.0+; this question pre-dates the existence of the Dates stdlib.)

更多推荐

如何在 Julia 中约会

本文发布于:2023-06-05 01:24:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/508980.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Julia

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!