End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Time#ctime
time.ctime → string
time.c
View on GitHub ↗
static VALUE
time_asctime(VALUE time)
{
return strftimev("%a %b %e %T %Y", time, rb_usascii_encoding());
}
Returns a canonical string representation of time.
Example
Time.now.asctime #=> "Wed Apr 9 08:56:03 2003" Time.now.ctime #=> "Wed Apr 9 08:56:03 2003"