keybored
keybored

Reputation: 5248

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

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 wrong.

Upvotes: 0

Views: 331

Answers (1)

Jochem Schulenklopper
Jochem Schulenklopper

Reputation: 6914

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

Upvotes: 1

Related Questions