日期时间的 strftime
我得到了下面的代码,我想将其转换为特定格式的字符串。但我无法让它工作。
Date.today + warning.notify_time_close.seconds
我想做的是这样的事情,但它不起作用:)
(Date.today + warning.notify_time_close.seconds).strftime "%d-%m-%Y %H:%M:%S"
我知道它很简单,但只是不知道该怎么做:)
提前致谢!
肯尼思
I got the below code which I would like to convert to a string in a specific format. But I can't get it working.
Date.today + warning.notify_time_close.seconds
What I want to do is somethin like this but it doesn't work :)
(Date.today + warning.notify_time_close.seconds).strftime "%d-%m-%Y %H:%M:%S"
I know its simple but just don't know how to do it :)
Thanks in advance!
Kenneth
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该不是必需的,但作为解决方法,您可以尝试以下操作:
This should not be necessary, but as a workaround you could try this: