开发者

Is there an equivalent in RoR for PHP's gmdate?

开发者 https://www.devze.com 2023-02-11 18:35 出处:网络
For instance, if I called: gmdate(\"M-D-yTh:i:s\") Is there something similar for this case in RoR? I guess I could always DateTime.now.hour, DateTime.now.year, etc. etc. but that seems extremely w

For instance, if I called:

gmdate("M-D-yTh:i:s")

Is there something similar for this case in RoR? I guess I could always DateTime.now.hour, DateTime.now.year, etc. etc. but that seems extremely wron开发者_开发技巧g.


See strftime() in Ruby's documentation on Time, which formats a time according to the directives in the given format string.

0

精彩评论

暂无评论...
验证码 换一张
取 消