instance method
DateTime#to_s
() -> ::String
dt.to_s → string
ext/date/date_core.c
View on GitHub ↗
static VALUE
dt_lite_to_s(VALUE self)
{
return strftimev("%Y-%m-%dT%H:%M:%S%:z", self, set_tmx);
}
Returns a string in an ISO 8601 format. (This method doesn’t use the expanded representations.)
Example
DateTime.new(2001,2,3,4,5,6,'-7').to_s #=> "2001-02-03T04:05:06-07:00"