gpt4 book ai didi

ruby - 在 ruby​​ 的 strftime 中,为什么 %P 是 "am/pm"而 %p 是 "AM/PM"

转载 作者:太空宇宙 更新时间:2023-11-03 17:40:11 29 4
gpt4 key购买 nike

这不是更困惑吗?难道不应该反过来这样更容易记住吗?

最佳答案

查看此备忘单:http://cheat.errtheblog.com/s/strftime/

Ruby 1.8 之前好像没有%P 选项,所以我认为当社区选择添加那个“特性”时,他们选择使用%p 来实现向后兼容并添加了%P 选项想要小写版本的用户。

不过,如果为了避免混淆而将它们互换也没有什么坏处。

关于ruby - 在 ruby​​ 的 strftime 中,为什么 %P 是 "am/pm"而 %p 是 "AM/PM",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6067860/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com